I\'m using GraphView library (see: https://github.com/jjoe64/GraphView or http://www.jjoe64.com/p/graphview-library.html)
But I would like to use Date/Time for the X
Here's the updated answer from jjoe64, with the x-values obtained from Date#getTime()
final DateFormat dateTimeFormatter = DateFormat.getDateTimeInstance();
graphView = new LineGraphView(context, "Chart");
graphView.setCustomLabelFormatter(new CustomLabelFormatter()
{
@Override
public String formatLabel(double value, boolean isValueX)
{
if (isValueX)
{
return dateTimeFormatter.format(new Date((long) value));
}
return null; // let graphview generate Y-axis label for us
}
});