Skip to content

Commit 815dee8

Browse files
committed
Corrected calcMinMaxY for autoScaleMinMax
1 parent 3398cf4 commit 815dee8

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

MPChartLib/src/main/java/com/github/mikephil/charting/data/CandleDataSet.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ protected void calcMinMax(CandleEntry e) {
112112
calcMinMaxX(e);
113113
}
114114

115+
@Override
116+
protected void calcMinMaxY(CandleEntry e) {
117+
118+
if (e.getHigh() < mYMin)
119+
mYMin = e.getHigh();
120+
121+
if (e.getHigh() > mYMax)
122+
mYMax = e.getHigh();
123+
124+
if (e.getLow() < mYMin)
125+
mYMin = e.getLow();
126+
127+
if (e.getLow() > mYMax)
128+
mYMax = e.getLow();
129+
}
130+
115131
/**
116132
* Sets the space that is left out on the left and right side of each
117133
* candle, default 0.1f (10%), max 0.45f, min 0f

0 commit comments

Comments
 (0)