| 95 | } |
| 96 | |
| 97 | buildTicks() { |
| 98 | const min = this.min; |
| 99 | const max = this.max; |
| 100 | const offset = this.options.offset; |
| 101 | const ticks = []; |
| 102 | let labels = this.getLabels(); |
| 103 | |
| 104 | // If we are viewing some subset of labels, slice the original array |
| 105 | labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1); |
| 106 | |
| 107 | this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1); |
| 108 | this._startValue = this.min - (offset ? 0.5 : 0); |
| 109 | |
| 110 | for (let value = min; value <= max; value++) { |
| 111 | ticks.push({value}); |
| 112 | } |
| 113 | return ticks; |
| 114 | } |
| 115 | |
| 116 | getLabelForValue(value) { |
| 117 | return _getLabelForValue.call(this, value); |