I'm using Chart.js to implement a Line chart. The X axis of this chart has many points, for example the integer range 1 to 200. Having this many points on the X axis causes an issue when displaying:
Is is possible to 'conflate' the labels so that I perhaps just show 1, 10, 20? This should only impact the labels and not remove points from the plotted line itself.
What I did was when generating the array for the labels, check if i % 10 === 0
where i
is the index of the label, if true, add the label to the array, if false, add empty string to the array.
Maybe not the cleanest way, but it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With