Background
For some charts in my app, I'm using the MPAndroidChart library. All horizontal axis' of my graphs are time based, they can span a full year, a month, a week, a day or span one hour. It always shows a full period, so January-December, Monday-Sunday, 0:00 - 24:00 etc. The value of the axis is always the epoch-timestamp (in seconds).
Requirement
I want the x-axis labels to follow these rules:
- at 1st of month in case of year span;
- at start of day in case of month or week span;
- on any full hour (##:00) (not perse all) in case of a day span;
- on any 5 minute point on an hour span.
Problem
I can set the granularity
of the x-axis, which makes sure there is no less space between two points then the granularity says, but that can mean that (in case of day span) the first label is at 1:00am, and the second at 2:01am and the third is at 3:16am, since that fits a granularity of (minimum) 60 minutes.
Current incorrect situation, which would ideally be something like [0:00, 3:00, 6:00, 9:00 ..]
Question
Is there a way to control the positioning of the x-axis labels to achieve the results above?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…