Skip to content

Commit

Permalink
Merge pull request #3265 from carlo-/master
Browse files Browse the repository at this point in the history
Min and Max reset when clearing ChartDataSet (Fixes #3260)
  • Loading branch information
liuxuan30 committed Feb 22, 2018
2 parents ae43f31 + eb2518a commit 8a0c223
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,22 @@ open class ChartDataSet: ChartBaseDataSet

open override func calcMinMax()
{
guard !values.isEmpty else { return }

_yMax = -Double.greatestFiniteMagnitude
_yMin = Double.greatestFiniteMagnitude
_xMax = -Double.greatestFiniteMagnitude
_xMin = Double.greatestFiniteMagnitude

guard !values.isEmpty else { return }

values.forEach { calcMinMax(entry: $0) }
}

open override func calcMinMaxY(fromX: Double, toX: Double)
{
guard !values.isEmpty else { return }

_yMax = -Double.greatestFiniteMagnitude
_yMin = Double.greatestFiniteMagnitude

guard !values.isEmpty else { return }

let indexFrom = entryIndex(x: fromX, closestToY: Double.nan, rounding: .down)
let indexTo = entryIndex(x: toX, closestToY: Double.nan, rounding: .up)
Expand Down

0 comments on commit 8a0c223

Please sign in to comment.