Skip to content

Commit

Permalink
Reset min/max when clearing ChartDataSet
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Jan 22, 2020
1 parent b7681bb commit 500f9d6
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,26 @@ public DataSet(List<T> values, String label) {
@Override
public void calcMinMax() {

if (mValues == null || mValues.isEmpty())
return;

mYMax = -Float.MAX_VALUE;
mYMin = Float.MAX_VALUE;
mXMax = -Float.MAX_VALUE;
mXMin = Float.MAX_VALUE;

if (mValues == null || mValues.isEmpty())
return;

for (T e : mValues) {
calcMinMax(e);
}
}

@Override
public void calcMinMaxY(float fromX, float toX) {

if (mValues == null || mValues.isEmpty())
return;

mYMax = -Float.MAX_VALUE;
mYMin = Float.MAX_VALUE;

if (mValues == null || mValues.isEmpty())
return;

int indexFrom = getEntryIndex(fromX, Float.NaN, Rounding.DOWN);
int indexTo = getEntryIndex(toX, Float.NaN, Rounding.UP);
Expand Down

0 comments on commit 500f9d6

Please sign in to comment.