diff --git a/common/changes/@visactor/vchart/fix-datazoom-change_2024-12-23-16-07.json b/common/changes/@visactor/vchart/fix-datazoom-change_2024-12-23-16-07.json new file mode 100644 index 0000000000..03ff939c66 --- /dev/null +++ b/common/changes/@visactor/vchart/fix-datazoom-change_2024-12-23-16-07.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vchart", + "comment": "fix: chart not update when datazoom change. fix#3597", + "type": "none" + } + ], + "packageName": "@visactor/vchart" +} \ No newline at end of file diff --git a/packages/vchart/src/component/data-zoom/data-zoom/data-zoom.ts b/packages/vchart/src/component/data-zoom/data-zoom/data-zoom.ts index fd2344c252..b9ce4ce3d0 100644 --- a/packages/vchart/src/component/data-zoom/data-zoom/data-zoom.ts +++ b/packages/vchart/src/component/data-zoom/data-zoom/data-zoom.ts @@ -332,7 +332,9 @@ export class DataZoom extends DataFilte this._component.addEventListener('change', (e: any) => { const { start, end, tag } = e.detail; - this._handleChange(start, end, undefined, tag); + // 传入tag后, datazoom每次只更新 startHandler / endHandler, 如果快速拖动会出现handler更新不及时的情况 + // 追溯上下文发现tag逻辑与auto有关(pull#1492), 所以在此做判断, 尽量不产生额外影响, 如果有额外影响应当再做处理 + this._handleChange(start, end, undefined, this._auto ? tag : undefined); }); container.add(this._component as unknown as INode); @@ -448,7 +450,8 @@ export class DataZoom extends DataFilte line: { visible: false }, area: { visible: false } }, - disableTriggerEvent: this._option.disableTriggerEvent + disableTriggerEvent: this._option.disableTriggerEvent, + disableDispatchOutSide: (this._spec as any).disableDispatchOutSide ?? false }; }