0

In the MPAndroidChart line chart, I have different kinds of data. When the data is all 0s, I would like to expand y range from 0.3 (which is the default value) to 10. However, when I use y.setAxisMaxValue(20f), y.setAxisMinValue(-20f) kinds of codes, it stays in the same range all the time. For instance, the normal data is like that but the data with all zeros like this picture. Then I use set axis min max values functions, the data with all zeros becomes the data I wanted as this. However, the normal data is gone to the somewhere I can't see like this graph

What can I do about this issue?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Z.Ozturk
  • 1
  • 1
  • Does this answer your question? [How to continuously update Y-axis values in MPAndroidChart](https://stackoverflow.com/questions/31934301/how-to-continuously-update-y-axis-values-in-mpandroidchart) If you set the axis range manually once, you must set it all the time. You might also try using `setAutoScaleMinMaxEnabled` to reset auto scaling, but I didn't try. – Nicolas Nov 27 '20 at 14:42
  • Yes I am using auto update for normal data which is perfect but I need to change the range of y axis when the data is full with zeros. – Z.Ozturk Nov 27 '20 at 14:46
  • Then check your data points and set the axis accordingly when updating. – Nicolas Nov 27 '20 at 14:48

0 Answers0