shyam_
shyam_

Reputation: 2470

NVD3 Line Chart X Axis Tick count

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

Upvotes: 3

Views: 1807

Answers (1)

shabeer90
shabeer90

Reputation: 5151

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.

Upvotes: 2

Related Questions