Android achartengine文本标签边距和填充

时间:2014-03-25 05:05:05

标签: android margin padding achartengine

enter image description here

嗨开发人员,我有一个问题:如何缩小标签和条形之间的差距,我已经尝试将XYMultipleSeriesRenderer的边距设置为不同的范围(正面和负面),但这并没有。 ; t影响标签和条形之间的差距。并且还将负值传递给renderer.setXLabelPadding()似乎被忽略 - 文本标签位于X轴上,因为图形旋转了90%

我正在使用achartengine 1.1.0,这应该是最新的。

这是我用来操纵外观的代码的一部分:

    renderer.setOrientation(Orientation.VERTICAL); //horizontal bar-graph
    renderer.clearXTextLabels();
    renderer.setYLabels(0); //remove units on the Y axis(the horizontal axis since the graph has been rotated 90 degree)
    renderer.setXLabels(0); //removes 'values' from the X-Axis
    renderer.setMargins(new int[]{10, 0, 90, 0}); //top, left, bottom, right. Since its a horizontal bar graph, the margins has been rotated clock-wise. setting them to negative doesn't solve my problem.

    renderer.addXTextLabel(0.9, "Average");
    renderer.addXTextLabel(1.2, "Maximum");
    renderer.setXLabelsPadding(-200f); //no effect
    renderer.setYLabelsPadding(-200f); //no effect

1 个答案:

答案 0 :(得分:0)

尝试render.setBarSpacing(float);用于条之间的间距。我用过这个并且有效。