正試圖在Android應用程序中繪製帶有achartengine的折線圖。該圖每隔幾秒自動刷新一次。問題是:如果沒有要繪製的數據,軸將不可見。即使沒有任何可以繪製的圖形,我如何使軸出現? 請幫忙。android achartengine:即使沒有繪圖數據,也顯示座標軸
private XYMultipleSeriesDataset graphDataset = null;
private XYMultipleSeriesRenderer graphRenderer = null;
private GraphicalView graphView;
.....
.....
this.graphDataset = new XYMultipleSeriesDataset();
this.graphRenderer = new XYMultipleSeriesRenderer();
this.graphRenderer.setXLabels(0);
...
/// other initialization code, like labels & fonts
...
// then i add the data to the series
XYSeries series = new XYSeries("Simple graph");
for (int i=0; i<valueArray.size();i++) {
series.add(valueArray.get(i), yValue.get(i));
}
this.graphDataset.addSeries(series);
....
// then I do renderer initialization
XYSeriesRenderer xyRenderer = this.setChartLineProperties(index);
...
// then finally initializing the graphview
this.graphView = ChartFactory.getLineChartView(this, this.graphDataset,
this.graphRenderer);
您可以顯示您在做什麼? – keshav