I use MPAndroidChart to display the stock chart, but the Y line value is so close,the chart is like this
I can use finger zoom like this way
Which is I want the default looks like
Is there any way to set Y line max and min value or set default zoom.
I tried the lib function , but it does not work
Take a look at the documentation of the YAxis. There are various methods that allow you to control the axis range.
setStartAtZero(boolean enabled)
: If this is enabled, this axis will always have it's minimum value at zero (0), no matter which kind of data the chart displays.setAxisMaxValue(float max)
: Set a custom maximum value for this axis. If set, this value will not be calculated automatically depending on the provided data. setAxisMinValue(float min)
: Set a custom minimum value for this axis. If set, this value will not be calculated automatically depending on the provided data. setSpaceTop(float percent)
: Sets the top spacing (in percent of the total axis-range) of the highest value in the chart in comparison to the highest value on the axis. setSpaceBottom(float percent)
: Sets the bottom spacing (in percent of the total axis-range) of the lowest value in the chart in comparison to the lowest value on the axis.