I have my real time d3 log scale graph like below:
I would like to show only the major ticks with their labels : 10^-2, 10^-1, 10^0, 10^1, 10^2
but not the minor ticks
I would like to have the log Y axis look like this without the minor ticks:
How can I do this?
EDIT: post some code
svg = d3.select("#chart1").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom);
y = d3.scale.log().domain([1e-1, 1e2]).range([height, 0]);
yAxis = d3.svg.axis().scale(y).orient("left");
svg.selectAll("g.y.axis")
.call(yAxis)
.selectAll(".tick text")
.text(null)
.filter(powerOfTen)
.text(10)
.append("tspan")
.attr("dy", "-.7em")
.text(function(d) { return Math.round(Math.log(d) / Math.LN10); });
You might also interested to know how to get the custom label of powerOfTen. If so, you might need to refer here
EDIT: You can edit my jsfiddle