gpt4 book ai didi

android - 如何在标签之间留出空格?

转载 作者:搜寻专家 更新时间:2023-11-01 08:40:40 26 4
gpt4 key购买 nike

我正在使用 Android 中的 MPAndroidChart 库。

我想在我的 BarChart 中的 XAxis 标签之间留出空格而不隐藏标签。

我使用这段代码,但它隐藏了标签并且不会在 xAxis 中的点之间留出空间:

mChart.setPinchZoom(false);

mChart.setDrawBarShadow(false);
mChart.setDrawGridBackground(false);

XAxis xAxis = mChart.getXAxis();
xAxis.setPosition(XAxisPosition.BOTTOM);
xAxis.setSpaceBetweenLabels(6);
xAxis.setXOffset(12);
xAxis.setTextSize(10);
xAxis.setDrawGridLines(false);

这是目前的样子:

lables in xAxis look so close to each other

在 xAxis 中的图像标签中,彼此非常接近,我如何在它们之间留出空间

最佳答案

试试 barDataSet.setBarSpacePercent(20f);20f 是您可以根据需要设置的示例值。

关于android - 如何在标签之间留出空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32901483/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com