I need some space before the first point and after the last point in the line chart showing below (red rectangle area). How do I achieve that in MPAndroidChart?
@hengstar. I meet the same question like you. The following codes work for me. I hope it will to help to you.
xAxis.setSpaceMax(0.5f);
xAxis.setSpaceMin(0.5f);
To start x - axis from 1st position add this code
xAxis.setAxisMinimum(mLineData.getXMin() - 0.5f);
xAxis.setAxisMaximum(mLineData.getXMax() + 0.5f);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With