如何使用aChartEngine库设置边缘\点边距

时间:2014-10-10 17:02:31

标签: android achartengine

我试图使用aChartEngine库,目前我正在使用演示样本进行一些测试,但我还没有找到一种方法来设置边缘点和它们的值之间的差距

查看截图

enter image description here

代码:

String[] titles = new String[] { "2008", "2007" };
    List<double[]> values = new ArrayList<double[]>();
    values.add(new double[] { 14230, 12300, 14240, 15244, 15900, 19200, 22030, 21200, 19500, 15500,
        12600, 14000 });
    values.add(new double[] { 5230, 7300, 9240, 10540, 7900, 9200, 12030, 11200, 9500, 10500,
        11600, 13500 });
    int[] colors = new int[] { Color.BLUE, Color.CYAN };
    XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
    setChartSettings(renderer, "Monthly sales in the last 2 years", "Month", "Units sold", 0.5,
        12.5, 0, 24000, Color.GRAY, Color.LTGRAY);
    ((XYSeriesRenderer) renderer.getSeriesRendererAt(0)).setDisplayChartValues(true);
    ((XYSeriesRenderer) renderer.getSeriesRendererAt(1)).setDisplayChartValues(true);
    renderer.setXLabels(12);
    renderer.setYLabels(10);
    renderer.setXLabelsAlign(Align.LEFT);
    renderer.setYLabelsAlign(Align.LEFT);
    renderer.setPanEnabled(true, false);
    // renderer.setZoomEnabled(false);
    renderer.setZoomRate(1.1f);
    renderer.setBarSpacing(0.5f);
    return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
        Type.STACKED);

如何设置边距以避免条形与其末端的值重叠?

0 个答案:

没有答案