How to put only the minimum and maximum on the D3 Scale scale?

Asked

Viewed 74 times

0

Creating the scale:

headers.forEach(function(d) {
            // Coerce values to numbers.
            jsonObj.forEach(function(p) {
                y[d] = d3.scale.linear().domain(
                        d3.extent(jsonObj, function(p) {
                            return +p[d] || 0;
                        })).range([ h, 0 ]);
                y[d].brush = d3.svg.brush().y(y[d]).on("brush", brush);
            });
        }); 



g.append("svg:g").attr("class", "axis").each(function(d) {
            d3.select(this).call(axis.scale(y[d]));

Upshot:

inserir a descrição da imagem aqui

What I want:

inserir a descrição da imagem aqui

Is it possible? How do I?

1 answer

1


I managed using Axis.ticks(2);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.