0
請看下圖,試圖弄清楚它爲什麼跳過'1','3'等等。Graphview不顯示所有的x軸值
我在哪裏設置的系列和圖:
DataPoint[] dataPoints = new DataPoint[rankList.size()]; // declare an array of DataPoint objects with the same size as your list
for (int i = 0; i < rankList.size(); i++) {
dataPoints[i] = new DataPoint(i, Double.parseDouble(rankList.get(i))); // not sure but I think the second argument should be of type double
}
BarGraphSeries<DataPoint> series2 = new BarGraphSeries<DataPoint>(dataPoints); // This one should be obvious right? :)
series2.setAnimated(true);
series2.setTitle("Random Curve 1");
series2.setColor(Color.GREEN);
series2.setSpacing(30);
series2.setDataWidth(1);
graph2.getViewport().setMinX(-1);
graph2.getViewport().setMaxX(12);
graph2.addSeries(series2);
正確的信息是該所描繪的,但我試過從文檔一堆東西,讓得到它的工作。
安置自己的代碼.. – Rahil2952
更新,我的道歉。 – AndroidDev21921