0
如何在一幅圖上結合折線圖和條形圖?文檔沒有提到這個功能。這是可能的AndroidPlot?AndroidPlot:如何在一個圖上組合不同的圖表類型?
如何在一幅圖上結合折線圖和條形圖?文檔沒有提到這個功能。這是可能的AndroidPlot?AndroidPlot:如何在一個圖上組合不同的圖表類型?
在你的活動中使用這個oncreate()
。
setContentView(R.layout.main);
XYPlot plot = (XYPlot) findViewById(R.id.mySimpleXYPlot);
Number[] series1Numeros = { 1, 8, 5, 2, 7, 4 };
XYSeries series1 = new SimpleXYSeries(Arrays.asList(series1Numeros),
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "Intereses");
XYSeries series = new SimpleXYSeries(Arrays.asList(new Number[] { 1, 2, 3, 4, 5 }),
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "title");
BarFormatter formatter = new BarFormatter(Color.rgb(0, 200, 0), Color.rgb(100, 0, 0));
plot.addSeries(series, BarRenderer.class, formatter);
BarRenderer renderer = (BarRenderer) plot.getRenderer(BarRenderer.class);
LineAndPointFormatter series1Format = new LineAndPointFormatter(Color.rgb(0, 200, 0),
Color.rgb(0, 100, 0),
null);
plot.addSeries(series1, series1Format);