d3/d3-scale

Question: How can I set d3 linearScale tick start and each stop length

georgezouq opened this issue · 1 comments

I want to change linearScale tick start and stop length. Say one linearScale domain (0-100) but tick is start in 20 and each tick stop 10. When use scale.ticks() generate tick list like: [20, 30, 40, 50, 60, 70, 80, 90, 100]. How can I do that?

Fil commented

short answer you can't do that on the scale itself https://github.com/d3/d3-scale#continuous_ticks

but if you're using these ticks to display an axis, then you can specify the ticks on the axis with axis.tickValues([20, 30…])
https://github.com/d3/d3-axis#axis_tickValues