3
votes

How to configure the no of ticks on nvd3 line chart axis.

I know that we can have no of tick count on d3 chart using following

var axis = d3.svg.axis().ticks([NO_of_Tick]).scale(widthscale);

How this can be done for nvd3 line chart.

enter image description here

1

1 Answers

2
votes

If you want to show all your xAxis tick values by default try using :

nv.models.multiBarChart().reduceXTicks(false);

Or if you want to show only certain tick values on your xAxis you could try this:

// Assuming your xAxis has 1-10
chart.xAxis.tickValues([1,2,3,4,5,6,7,8,9,10])

Hope it helps.