MPAndroidChart
MPAndroidChart copied to clipboard
LineDataSet.clear() does not clear x/y min/max
For the LineDataSet, the mValues is cleared and then calcMinMax is called through notifyDataSetChanged.
However if the mValues is size 0, the min/max is not updated....
public void clear() {
this.mValues.clear();
this.notifyDataSetChanged();
}
public void notifyDataSetChanged() {
this.calcMinMax();
}
@Override
public void calcMinMax() {
if(this.mValues != null && !this.mValues.isEmpty()) {
this.mYMax = -3.4028235E38F;
this.mYMin = 3.4028235E38F;
this.mXMax = -3.4028235E38F;
this.mXMin = 3.4028235E38F;
Iterator var1 = this.mValues.iterator();
while(var1.hasNext()) {
Entry e = (Entry)var1.next();
this.calcMinMax(e);
}
}
}
this.calcMinMax(); is not worked.
.getXMax() do not update
becouse after .clear mValues=0!
only this-worked:
set1.clear();
set1.addEntry(new Entry(0, 0));
set1.notifyDataSetChanged();