novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.14k forks source link

set count of ticks in chart nv3 in model multiBarChart #2218

Open mkhataei opened 4 years ago

mkhataei commented 4 years ago

I`m using multiBarChart and set reduceXTicks true. how can I set count of xTicks? this is my result my chart and my code is here

var chart = nv.models.multiBarChart()
    .duration(350)
    .reduceXTicks(true)
    .rotateLabels(-45)
    .stacked(true)
    .showControls(false)
    .groupSpacing(0.3)

chart.yAxis.tickFormat(d3.format('f'));
d3.select('#chart svg')
    .datum(prepareData())
    .call(chart);