Accepted answer

You can use the ticks(number) method on the axis to tell it to draw fewer ticks; the default is to draw approximately 10 ticks. The actual number of ticks is adjusted to get round-number intervals between tick values, which is why you were getting 12 ticks using the default behaviour.

For your case you want to use

y.axis = d3.svg.axis().ticks(6).scale(y).orient("left")

Related Query

More Query from same tag