Skip to content

Commit

Permalink
Merge pull request ChartsOrg#2229 from aelam/patch-2
Browse files Browse the repository at this point in the history
Fixed, If the last value is the max or min, the range will be wrong
  • Loading branch information
liuxuan30 committed May 26, 2017
2 parents 238c842 + cfb405a commit d6c474e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ open class ChartDataSet: ChartBaseDataSet
let indexFrom = entryIndex(x: fromX, closestToY: Double.nan, rounding: .down)
let indexTo = entryIndex(x: toX, closestToY: Double.nan, rounding: .up)

if indexTo <= indexFrom { return }
if indexTo < indexFrom { return }

for i in indexFrom..<indexTo
for i in indexFrom...indexTo
{
// only recalculate y
calcMinMaxY(entry: _values[i])
Expand Down

0 comments on commit d6c474e

Please sign in to comment.