【发布时间】:2014-08-14 11:19:28
【问题描述】:
我创建了一个 LineGraph,它看起来像这样:
但我想像这样填充抓地力下方的区域:
如何实现此功能?你能帮帮我吗?
【问题讨论】:
-
太晚了,但你能找到解决方案吗?
标签: android graph android-graphview
我创建了一个 LineGraph,它看起来像这样:
但我想像这样填充抓地力下方的区域:
如何实现此功能?你能帮帮我吗?
【问题讨论】:
标签: android graph android-graphview
使用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);
【讨论】: