我已经创建了一个折线图,它看起来像这样:
setDrawBackground
方法启用它。LineGraphView graphView = new LineGraphView(this,"My Line Graph");
graphView.setDrawBackground(true);
如果您使用的是GraphView的更高版本,请在数据系列上设置背景色并启用drawBackground属性:
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);