I have a d3 bar chart whose values range from 0-3. I would like the y-axis to only show integer values, which I can do by
var yAxis = d3.svg.axis().scale(y).orient("right").tickFormat(d3.format("d"));
However, there are still tick marks at the non-integer markings. Setting the tick format only hides those labels. I can explicitly set the number of ticks or the tick values, but what I'd like to do is to just be able to specify that tick marks only appear at integer values. Is that possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…