Skip to content

Commit a4dfbec

Browse files
committed
fix: code review
1 parent 1808e50 commit a4dfbec

File tree

2 files changed

+47
-9
lines changed

2 files changed

+47
-9
lines changed

src/coord/scaleRawExtentInfo.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ export class ScaleRawExtentInfo {
7070
readonly frozen: boolean;
7171

7272
// custom dataMin/dataMax
73-
private _dataMinRaw: ScaleDataValue;
74-
private _dataMaxRaw: ScaleDataValue;
7573
private _dataMinNum: number;
7674
private _dataMaxNum: number;
7775

@@ -103,16 +101,16 @@ export class ScaleRawExtentInfo {
103101
const isOrdinal = this._isOrdinal = scale.type === 'ordinal';
104102
this._needCrossZero = scale.type === 'interval' && model.getNeedCrossZero && model.getNeedCrossZero();
105103

106-
if (scale.type === 'interval' || scale.type === 'log') {
104+
if (scale.type === 'interval' || scale.type === 'log' || scale.type === 'time') {
107105
// Process custom dataMin/dataMax
108-
this._dataMinRaw = (model as AxisBaseModel<NumericAxisBaseOptionCommon>).get('dataMin', true);
109-
if (this._dataMinRaw != null) {
110-
this._dataMinNum = parseAxisModelMinMax(scale, this._dataMinRaw);
106+
const dataMinRaw = (model as AxisBaseModel<NumericAxisBaseOptionCommon>).get('dataMin', true);
107+
if (dataMinRaw != null) {
108+
this._dataMinNum = parseAxisModelMinMax(scale, dataMinRaw);
111109
}
112110

113-
this._dataMaxRaw = (model as AxisBaseModel<NumericAxisBaseOptionCommon>).get('dataMax', true);
114-
if (this._dataMaxRaw != null) {
115-
this._dataMaxNum = parseAxisModelMinMax(scale, this._dataMaxRaw);
111+
const dataMaxRaw = (model as AxisBaseModel<NumericAxisBaseOptionCommon>).get('dataMax', true);
112+
if (dataMaxRaw != null) {
113+
this._dataMaxNum = parseAxisModelMinMax(scale, dataMaxRaw);
116114
}
117115
}
118116

test/axis-data-min-max.html

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)