Я попытался построить линейный график с помощью GraphView. Используемый код:
if (list.size() > 0) {
GraphView graph = new LineGraphView(this, "Score");
GraphViewData[] graphData = new GraphViewData[list.size()];
for (int i = 0; i < list.size(); i++) {
graphData[i] = new GraphViewData(i, list.get(i).getScore());
}
graph.getGraphViewStyle().setNumHorizontalLabels(list.size());
graph.getGraphViewStyle().setNumVerticalLabels(list.size());
graph.getGraphViewStyle().setGridColor(getResources().getColor(R.color.blue));
graph.getGraphViewStyle().setHorizontalLabelsColor(getResources().getColor(R.color.greenYes));
graph.addSeries(new GraphViewSeries(graphData));
mLayout.addView(graph);
}
Но после завершения выполнения этого кода экран остается белым, т.е. на экране ничего не рисуется. Размер списка >0.
xml это:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/tvLevelCompleteScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="@dimen/textSize25" />
<TextView
android:id="@+id/tvLevelCompleteCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="@dimen/textSize25" />
</LinearLayout>
</ScrollView>
и mlayout инициализируется как:
mLayout = (LinearLayout) findViewById(R.id.linearLayout);
Есть идеи, что мне не хватает?
Любая помощь будет высоко оценена.
Спасибо