它只是在每个条之间增加了不必要的空间。我如何减少或删除它?所有数据都是动态生成的..我尝试设置条形宽度但它不起作用..
请看附图。。
更新代码
XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
mRenderer.setXLabelsColor(Color.BLUE);
mRenderer.setYLabelsColor(0, Color.BLUE);
mRenderer.setScale(0.5f);
mRenderer.setBarSpacing(0.5f);
mRenderer.setBarWidth(75);
mRenderer.setAxisTitleTextSize(10);
mRenderer.setXLabelsAlign(Align.CENTER);
mRenderer.setYLabelsAlign(Align.RIGHT);
mRenderer.setMargins(new int[] { 20, 30, 20, 0 });
mRenderer.setXTitle("Categories");
mRenderer.setYTitle("Amount");
for (int j = 0; j < availCatList.size(); j++) {
mRenderer.addXTextLabel(j + 1, availCatList.get(j));
}
mRenderer.setXLabels(0);
mRenderer.setChartTitle("Bar Chart");
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
for (int i = 0; i < availCatList.size(); i++) {
XYSeries series = new XYSeries(availCatList.get(i));
series.add(i + 1, mTotal.get(i));
dataset.addSeries(series);
XYSeriesRenderer seriesRenderer = new XYSeriesRenderer();
seriesRenderer.setChartValuesSpacing(0.5f);
seriesRenderer.setChartValuesTextAlign(Align.CENTER);
seriesRenderer.setChartValuesTextSize(10.0f);
seriesRenderer.setDisplayChartValues(true);
Random r = new Random();
int color = Color.argb(255, r.nextInt(256), r.nextInt(256),
r.nextInt(256));
seriesRenderer.setColor(color);
mRenderer.addSeriesRenderer(seriesRenderer);
}
view = ChartFactory.getBarChartView(this, dataset, mRenderer,
Type.DEFAULT);
layout.addView(view);
任何帮助将不胜感激..