Question:
I want to set Y Axis by 0-100 percent in the intervals of0-25-50-75-100
.For that I am setting ticks to 4.
But I can see Y axis in the intervals of
0-20-40-60-80-100
How can I set Y axis in the intervals of 0-25-50-75-100 ??
I have below code –
Answer:
d3 takes priority for some of the tick functions , you can do force tick Values by tickValues(d3.range(minValue, maxValue, noOfSteps)); . In your caseyAix.tickSize(-width).tickValues(d3.range(0,100,4).tickFormat(function(d){return d + “%”})
or use tickValues(d3.range(d3.min(dataarray),d3.max(dataarray),noOfticks))
If you have better answer, please add a comment about this, thank you!