diff --git a/src/component/dataZoom/AxisProxy.ts b/src/component/dataZoom/AxisProxy.ts index e9c997d9af..2d7b0f8a52 100644 --- a/src/component/dataZoom/AxisProxy.ts +++ b/src/component/dataZoom/AxisProxy.ts @@ -139,8 +139,8 @@ class AxisProxy { calculateDataWindow(opt?: { start?: number end?: number - startValue?: number - endValue?: number + startValue?: number | string | Date + endValue?: number | string | Date }) { const dataExtent = this._dataExtent; const axisModel = this.getAxisModel(); diff --git a/src/component/dataZoom/DataZoomModel.ts b/src/component/dataZoom/DataZoomModel.ts index 17b1005484..6ed6ccda0a 100644 --- a/src/component/dataZoom/DataZoomModel.ts +++ b/src/component/dataZoom/DataZoomModel.ts @@ -101,11 +101,11 @@ export interface DataZoomOption extends ComponentOption { /** * Start value. If startValue specified, start is ignored */ - startValue?: number + startValue?: number | string | Date /** * End value. If endValue specified, end is ignored. */ - endValue?: number + endValue?: number | string | Date /** * Min span percent, 0 - 100 * The range of dataZoom can not be smaller than that. @@ -507,7 +507,7 @@ class DataZoomModel extends Compon setCalculatedRange(opt: RangeOption): void { const option = this.option; each(['start', 'startValue', 'end', 'endValue'] as const, function (name) { - option[name] = opt[name]; + (option as any)[name] = opt[name]; }); } @@ -590,7 +590,7 @@ function retrieveRawOption(option: T) { each( ['start', 'end', 'startValue', 'endValue', 'throttle'] as const, function (name) { - option.hasOwnProperty(name) && (ret[name] = option[name]); + option.hasOwnProperty(name) && ((ret as any)[name] = option[name]); } ); return ret;