Skip to content

Commit

Permalink
Fix the mess caused by the setting the min&min value of the y-axis by…
Browse files Browse the repository at this point in the history
… error
  • Loading branch information
potato04 committed Sep 27, 2018
1 parent 6cbecb8 commit 526a73a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Source/Charts/Components/YAxis.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,19 @@ open class YAxis: AxisBase
var min = _customAxisMin ? _axisMinimum : dataMin
var max = _customAxisMax ? _axisMaximum : dataMax

min = max < min ? max : min
max = min > max ? min : max
if min > max {
if _customAxisMax && _customAxisMin {
//both max and min are manullay setted
min = max < min ? max : min
max = min > max ? min : max
} else if _customAxisMax && !_customAxisMin {
min = max - 1
} else if !_customAxisMax && _customAxisMin {
max = min + 1
}
}



// temporary range (before calculations)
let range = abs(max - min)
Expand Down

0 comments on commit 526a73a

Please sign in to comment.