Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed, If the last value is the max or min, the range will be wrong #2229

Merged
merged 4 commits into from May 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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