Reputation: 745
I am looking for a kind dynamic way to display the tick labels/values, when zooming the chart. This feature is available in some another js chart package, I am not sure if its available in c3, or because I didn't find this feature in c3 document.
zoom in the chart:
but, because my chart has many x values, so at the start, then tick value are overlapped:
if i define: culling:{max:30}, the initial chart looks ok:
but when zoom in the chart, the tick will show no more than 30:
Anyone can help? thanks very much!
Upvotes: 3
Views: 2624
Reputation: 15172
Look at onzoomend
: http://c3js.org/reference.html#zoom-onzoomend
It gives you the min & max that it was zoomed to. You can use this to calculate what the culling property should be set to.
In other words, if you start fully zoomed out with a culling value of 30, and the user then zooms in, you might want to double that to 60 to show double the amount of labels. Or you might want to disable culling entirely if they're zoomed in close enough.
Upvotes: 1