File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
MPChartLib/src/main/java/com/github/mikephil/charting/charts Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,12 @@ protected void onDraw(Canvas canvas) {
210210 if (mXAxis .isEnabled ())
211211 mXAxisRenderer .computeAxis (mXAxis .mAxisMinimum , mXAxis .mAxisMaximum , false );
212212
213+ // Y-axis labels could have changed in size affecting the offsets
214+ if (mAutoScaleMinMaxEnabled ) {
215+ calculateOffsets ();
216+ mViewPortHandler .refresh (mViewPortHandler .getMatrixTouch (), this , false );
217+ }
218+
213219 mXAxisRenderer .renderAxisLine (canvas );
214220 mAxisRendererLeft .renderAxisLine (canvas );
215221 mAxisRendererRight .renderAxisLine (canvas );
@@ -366,19 +372,7 @@ protected void autoScale() {
366372
367373 mData .calcMinMaxY (fromX , toX );
368374
369- mXAxis .calculate (mData .getXMin (), mData .getXMax ());
370-
371- // calculate axis range (min / max) according to provided data
372-
373- if (mAxisLeft .isEnabled ())
374- mAxisLeft .calculate (mData .getYMin (AxisDependency .LEFT ),
375- mData .getYMax (AxisDependency .LEFT ));
376-
377- if (mAxisRight .isEnabled ())
378- mAxisRight .calculate (mData .getYMin (AxisDependency .RIGHT ),
379- mData .getYMax (AxisDependency .RIGHT ));
380-
381- calculateOffsets ();
375+ calcMinMax ();
382376 }
383377
384378 @ Override
You can’t perform that action at this time.
0 commit comments