2
我使用achartEngine繪製堆疊bar-graph.My情節爲X的Y值重疊和情節比其他較小值被擠壓out.Below是我builddataset和ChartFactory的achartengine堆疊條形圖的X和Y圖彼此重疊?
protected XYMultipleSeriesDataset buildBarDataset(String[] titles, List<double[]> values) {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
int length = titles.length;
for (int i = 0; i < length; i++) {
CategorySeries series = new CategorySeries(titles[i]);
double[] v = values.get(i);
int seriesLength = v.length;
for (int k = 0; k < seriesLength; k++) {
series.add(v[k]);
}
dataset.addSeries(i,series.toXYSeries());
}
return dataset;
}
我ChartFactory的:
mChartView = ChartFactory.getBarChartView(NTViewGraph.this, buildBarDataset(titles, values), renderer,
Type.STACKED);