()
| 179 | } |
| 180 | |
| 181 | handleTickRangeOptions() { |
| 182 | const {beginAtZero} = this.options; |
| 183 | const {minDefined, maxDefined} = this.getUserBounds(); |
| 184 | let {min, max} = this; |
| 185 | |
| 186 | const setMin = v => (min = minDefined ? min : v); |
| 187 | const setMax = v => (max = maxDefined ? max : v); |
| 188 | |
| 189 | if (beginAtZero) { |
| 190 | const minSign = sign(min); |
| 191 | const maxSign = sign(max); |
| 192 | |
| 193 | if (minSign < 0 && maxSign < 0) { |
| 194 | setMax(0); |
| 195 | } else if (minSign > 0 && maxSign > 0) { |
| 196 | setMin(0); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | if (min === max) { |
| 201 | let offset = max === 0 ? 1 : Math.abs(max * 0.05); |
| 202 | |
| 203 | setMax(max + offset); |
| 204 | |
| 205 | if (!beginAtZero) { |
| 206 | setMin(min - offset); |
| 207 | } |
| 208 | } |
| 209 | this.min = min; |
| 210 | this.max = max; |
| 211 | } |
| 212 | |
| 213 | getTickLimit() { |
| 214 | const tickOpts = this.options.ticks; |
no test coverage detected