我需要将图表合并到我的 android 应用程序中,我正在尝试遵循本教程:
http://www.jjoe64.com/2011/07/chart-and-graph-library-for-android.html
我尝试将它放入我的活动课程中,但它显示了大量与GraphView
. 以下是代码片段:
// graph with dynamically genereated horizontal and vertical labels
GraphView graphView = new GraphView(
this // context
, new GraphViewData[] {
new GraphViewData(1, 2.0d)
, new GraphViewData(2, 1.5d)
, new GraphViewData(2.5, 3.0d) // another frequency
, new GraphViewData(3, 2.5d)
, new GraphViewData(4, 1.0d)
, new GraphViewData(5, 3.0d)
} // data
, "GraphViewDemo" // heading
, null // dynamic labels
, null // dynamic labels
);
LinearLayout layout = (LinearLayout) findViewById(R.id.graph1);
layout.addView(graphView);