Android GraphView - how to fill the area under the line graph with color?
2 answers
For more accurate versions of GraphView, set the background color and drawBackground in series:
GraphView graph = (GraphView) findViewById(R.id.YOUR_GRAPH_ID_HERE);
LineGraphSeries<DataPoint> mySeries = new LineGraphSeries<DataPoint>(new DataPoint[] {
new DataPoint(0, 0),
new DataPoint(1, 5),
new DataPoint(2, 10)
});
mySeries.setBackgroundColor(Color.GREEN);
mySeries.setDrawBackground(true);
graph.addSeries(mySeries);
0
source to share