I am trying to display a time on my X axis with a fixed interval. Currently the X axis is not behaving like I want it to. I'm trying to have an interval of 5 minutes. When I zoom in my points are at the right timestamp.
Asked
Active
Viewed 915 times
1 Answers
0
Maybe you can use setGranularity API:
xAxis.setGranularityEnabled(true);
xAxis.setGranularity(5 * 60 * 1000); // if time is in ms

anhtuannd
- 918
- 9
- 16
-
Unfortunately, this has no effect. I have been trying to mess with the granularity but it never changes anything in my chart – user9621085 Oct 23 '18 at 15:16
-
Nevermind ! If I set the interval to something bigger like 30 minutes it is working. Thank you very much – user9621085 Oct 23 '18 at 15:19
-
Then next question would be how to show x-axis value only for shown label? – stuckedunderflow Oct 20 '21 at 15:35