Reputation: 2979
I have created a LineGraph, it´s look like this:
But I want fill the area below the grap like this:
How can I implement this feature? Can you help me?
Upvotes: 3
Views: 3572
Reputation: 2043
For more current versions of GraphView, set the background colour and drawBackground on the 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);
Upvotes: 2
Reputation: 66
Use the setDrawBackground
method to enable it.
LineGraphView graphView = new LineGraphView(this,"My Line Graph");
graphView.setDrawBackground(true);
Upvotes: 5