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) {
210
210
if (mXAxis .isEnabled ())
211
211
mXAxisRenderer .computeAxis (mXAxis .mAxisMinimum , mXAxis .mAxisMaximum , false );
212
212
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
+
213
219
mXAxisRenderer .renderAxisLine (canvas );
214
220
mAxisRendererLeft .renderAxisLine (canvas );
215
221
mAxisRendererRight .renderAxisLine (canvas );
@@ -366,19 +372,7 @@ protected void autoScale() {
366
372
367
373
mData .calcMinMaxY (fromX , toX );
368
374
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 ();
382
376
}
383
377
384
378
@ Override
You can’t perform that action at this time.
0 commit comments