Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Set interval in x- axis values in chart
hi,
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.
Hi,
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!