Currently, the code below displays the attached bar graph, with a scale that includes decimals and starts at 2.
My question is: Is there a way to start the y-axis labels from 0, and increase in integers up to the maximum value of the data? For example in this, 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);