Basically I need to use the Graphview Api (http://www.android-graphview.org/documentation/line-graph-series-in-detail#comments) to plot some data from my highscores.
So far I can create a line graph that contains data hardcoded in, like so:
GraphView graph = (GraphView) findViewById(R.id.graph);
LineGraphSeries<DataPoint> series = new LineGraphSeries<DataPoint>(new DataPoint[] {
// date then score
new DataPoint(0, 1),
new DataPoint(1, 5),
new DataPoint(2, 3),
new DataPoint(3, 2),
new DataPoint(2, 2)
});
graph.addSeries(series);
However my data is stored in 2 arraylists
final ArrayList<Date>date = new ArrayList<Date>();
final ArrayList<BigDecimal> score= new ArrayList<BigDecimal>();
I would like to plot the graph using the dates as the horizontal axis and the score as the vertical.
I've never used graphview before and I'm struggling to grasp how to use it effectively .
Any help would be great Thanks