减少X轴标签MPAndroidChart之间的间隙

时间:2019-08-20 10:31:35

标签: android mpandroidchart

我正在尝试减小条形和标签之间的默认间隙。我设法减小了条形之间的间隙,但是在尝试减小X轴标签之间的间隙时遇到了问题。

Before decreasing space between bars

After decreasing space between bars

我希望标签和条对齐。为X轴设置的属性为:

XAxis xl = chart.getXAxis();
xl.setPosition(XAxis.XAxisPosition.BOTTOM);
xl.setDrawAxisLine(false);
xl.setDrawGridLines(false);
xl.setGranularity(1f);
xl.setGranularityEnabled(true);
xl.setTypeface(tf);
xl.setTextSize(14);
xl.setEnabled(true);
xl.setCenterAxisLabels(false);
xl.setAxisMaximum(40f);

0 个答案:

没有答案