Set interval in x- axis values in chart


I have time vs distance chart in my project and x axis shows time in seconds.
for 24 hr run it contains minimum 17000 rows and the gap between x axis values are very less.
I want to set the x axis value in hourly format. only 24 labels but it should contain all 17000 values in chart.
please help me.


You can set the tick interval for the axis in the following way:

configuration.getxAxis().setTickInterval(60 * 60 * 1000); Remember that if axis is datetime you’ll need to set the inverval in milliseconds like in the code snippet.

Depending on the size of your chart it’s possible that not all labels are visible because they don’t fit, you can force visibility with:

configuration.getxAxis().getLabels().setStep(1); But then you might end up with overlapping labels (in this case you can test setting the labels rotation).

Hope this helps!