3
目前,下面的代碼顯示附條形圖,與包括小數,並在2GraphView垂直標籤在整數從0遞增
我的問題是啓動一個規模:是否有一個啓動Y-方式軸標籤從0開始,並且整數增加到數據的最大值?例如在此,0,1,2,3,4,5?
barData = this.getIntent().getExtras().getString("GraphData");
GraphViewSeries barGraphSeries = new GraphViewSeries(
new GraphViewData[] {
new GraphViewData(0, Integer.parseInt(barData
.substring(0, barData.indexOf(",")))),
new GraphViewData(1, Integer.parseInt(barData
.substring(barData.indexOf(",") + 1,
barData.length()))) });
GraphView statGraphView = new BarGraphView(this,
"Current Stat Graph");
statGraphView.getGraphViewStyle().setGridColor(Color.BLACK);
statGraphView.getGraphViewStyle().setHorizontalLabelsColor(
Color.BLACK);
statGraphView.getGraphViewStyle().setVerticalLabelsColor(
Color.BLACK);
String[] horLabels = { "Correct", "Incorrect" };
statGraphView.setHorizontalLabels(horLabels);
statGraphView.getGraphViewStyle().setNumHorizontalLabels(2);
statGraphView.getGraphViewStyle().setNumVerticalLabels(10);
statGraphView.addSeries(barGraphSeries);
LinearLayout layout = (LinearLayout) findViewById(R.id.graph1);
layout.addView(statGraphView);
這非常明確和有益的,謝謝! – otherdan
不客氣。不要忘記投票和標記解決;) – user3261759
真的很有用,非常感謝! –