Trying to add date in X axis - GraphView for Android
I need help, I want to show my GraphView date on DD / MM / YYYY on x axis. And in the y-axis number (Integer) ... how can I add the date to the X-axis, it only gets an int. (I am using this library http://android-graphview.org/ )
+3
source to share
2 answers
There is a post about this topic in this documentation:
http://www.android-graphview.org/documentation/label-formatter
There is also a specific example for dates in the axis - "Use dates as labels".
If you set the X value as a Date object or as unix epoch (millis from 1970-01-01) you can easily use this predefined label format:
graph.getGridLabelRenderer().setLabelFormatter(new DateAsXAxisLabelFormatter(getActivity()));
+4
source to share