Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset min/max when clearing ChartDataSet
Browse files Browse the repository at this point in the history
danielgindi committed Jan 23, 2020
1 parent 85ae13b commit f9f1f2b
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit f9f1f2b

Please sign in to comment.