Bar chart spacing between bars - v3.0.0-beta
I want to set the spacing between bar charts. After some research, I found in this issue https://github.com/PhilJay/MPAndroidChart/issues/197 a method from BarDataSet:
barDataSet.setBarSpacePercent(...);
That works in version 2.2.5. However, I can't find any method related to that in version 3.0.0-beta.
How can I do that?
Thanks!
barData.setBarWidth(0.5f)(half of the original width)
You can control the bar width by calling barData.setBarWidth(...). Concerning the space between bars, that can be controlled by the position on the x-axis you place your bars.
Concerning the space between bars, that can be controlled by the position on the x-axis you place your bars. Please be brief about it? Any code sample to prove?
@econBabar I ended up using: mChart.getXAxis().setSpaceMax(5f);
use barData.setBarWidth(1f); // without space between columns
if you want set space, try decrease (0.9f, 0.8f...)
use barData.setBarWidth(1f); It is working for me.