I am using MPAndroidChart library and have a set of data entries where the Y values are between 20 - 30 and I'm currently displaying it in a Line chart. However, I notice that there is a big gap because the Y-axis starts at 0 instead of 20.
How can I make Y-axis to start at the 20 instead of 0? Or even better the minimum of all y-values?
Thank you for your time!
You can find this in the documentation.
yAxis.setAxisMinValue(...)
allows you to adjust the lower limit of the axis to your needs.
The last version includes a left and right axis. You can set to zero like this (Kotlin):
chart.axisLeft.axisMinimum = 0f
chart.axisRight.axisMinimum = 0f
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