UNPKG

467 BPlain TextView Raw
1import Continuous from './base';
2
3/**
4 * 线性度量
5 * @class
6 */
7export default class Linear extends Continuous {
8 public minTickInterval: number;
9 public type = 'linear';
10 public readonly isLinear: boolean = true;
11
12 public invert(value: number): any {
13 const percent = this.getInvertPercent(value);
14 return this.min + percent * (this.max - this.min);
15 }
16
17 protected initCfg() {
18 this.tickMethod = 'wilkinson-extended';
19 this.nice = false;
20 }
21}