我需要刷新 AChartEngine 的值。我正在刷新 GraphicalView 并重新绘制实例,但值没有得到更新。
我是两个XYSeries如下。
waterSeries = new XYSeries("values");
waterSeries.add(1, y1[0]);
waterSeries.add(2, y1[1]);
waterSeries.add(3, y1[2]);
waterSeries.add(4, y1[3]);
waterSeries.add(5, y1[4]);
waterSeries.add(6, y1[5]);
waterSeries.add(7, y1[6]);
waterSeries.add(8, y1[7]);
waterSeries.add(9, y1[8]);
waterSeries.add(10, y1[9]);
waterSeries.add(11, y1[10]);
waterSeries.add(12, y1[11]);
waterSeries2 = new XYSeries("values");
waterSeries2.add(1, y2[0]);
waterSeries2.add(2, y2[1]);
waterSeries2.add(3, y2[2]);
waterSeries2.add(4, y2[3]);
waterSeries2.add(5, y2[4]);
waterSeries2.add(6, y2[5]);
waterSeries2.add(7, y2[6]);
waterSeries2.add(8, y2[7]);
waterSeries2.add(9, y2[8]);
waterSeries2.add(10, y2[9]);
waterSeries2.add(11, y2[10]);
waterSeries2.add(12, y2[11]);
当我滚动 SeekBar 时,这些值会被交换。我正在尝试重新绘制 GraphicalView 类(grfv)的实例,如下所示。
dataset = buildDataset(titles, x, values);
dataset.addSeries(0, series1);
dataset.addSeries(0, series2);
renderer.addSeriesRenderer(0, waterRenderer);
renderer.addSeriesRenderer(0, xxRenderer);
waterRenderer.setDisplayChartValues(true);
waterRenderer.setChartValuesTextSize(10);
String[] types = new String[] { BarChart.TYPE, LineChart.TYPE, LineChart.TYPE };
final GraphicalView grfv = ChartFactory.getCombinedXYChartView(this, dataset, renderer, types);
grfv.setBackgroundColor(Color.parseColor("#ffffff"));
renderer.setMarginsColor(Color.parseColor("#ffffff"));
grfv.repaint();
grfv.invalidate();
请帮助我解决此问题的任何代码。
提前致谢。Sundeep.S.