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
I created the horizontal labels at the same time I was setting the values:
public void initializeLineGraphView() {
// Get last weeks entries from the DB
ArrayList entries = DbManager.getInstance().getLastWeeksEntries(new Date());
String[] hLabels = new String[entries.size()];
GraphView.GraphViewData[] graphViewData = new GraphView.GraphViewData[entries.size()];
for(int i = 0; i < entries.size(); i++) {
Entry entry = entries.get(i);
int pain = entry.getPain();
graphViewData[i] = new GraphView.GraphViewData(i, pain);
// Generate the horizontal labels
SimpleDateFormat sdf = new SimpleDateFormat("EEE");
String dayOfWeek = sdf.format(entry.getDate());
hLabels[i] = dayOfWeek;
}
mSeries = new GraphViewSeries("", null, graphViewData);
GraphView graphView = new LineGraphView(getActivity(), "");
graphView.addSeries(mSeries);
graphView.setHorizontalLabels(hLabels);
graphView.setVerticalLabels(new String[] {"10", "5", "0"});
mLineGraphView = graphView;
}