我需要整合的圖形到我的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);