* @private
()
| 141 | * @private |
| 142 | */ |
| 143 | _resetRange() { |
| 144 | const dataExtent = this.getExtent(); |
| 145 | const range = this.option.range; |
| 146 | |
| 147 | if (!range || (range as RangeWithAuto).auto) { |
| 148 | // `range` should always be array (so we don't use other |
| 149 | // value like 'auto') for user-friend. (consider getOption). |
| 150 | (dataExtent as RangeWithAuto).auto = 1; |
| 151 | this.option.range = dataExtent; |
| 152 | } |
| 153 | else if (zrUtil.isArray(range)) { |
| 154 | if (range[0] > range[1]) { |
| 155 | range.reverse(); |
| 156 | } |
| 157 | range[0] = Math.max(range[0], dataExtent[0]); |
| 158 | range[1] = Math.min(range[1], dataExtent[1]); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * @protected |
no test coverage detected