[Bug] Restore feature not properly resetting zoom feature

未关闭
#21,644 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript

调研方向

使用 Zoom 和 Restore toolbox 按钮在官方 line-aqi ECharts 示例中重现回归,并将行为与 ECharts 6.0.0 进行比较。检查 Zoom/Restore 交互和 datazoom listener 的行为;完成标准是 Restore 重置图表、toolbox 状态和鼠标图标,并且重复 Restore 不会累积 datazoom 输出。

由索引模型根据 Issue 内容生成。

描述

bug en pending
Version

6.1.0

Link to Minimal Reproduction

All echarts official example demos with Zoom/Zoom Reset and Restore toolbox buttons, e.g: https://echarts.apache.org/examples/en/editor.html?c=line-aqi

Steps to Reproduce
  1. Run any echarts example demo that has Zoom/Zoom Reset and Restore toolbox buttons
    -- for example: https://echarts.apache.org/examples/en/editor.html?c=line-aqi
  2. Move the mouse over the chart
    -- Mouse icon will NOT display the zoom icon ("+")
    -- good
  3. Click on the Zoom toolbox button and then move the mouse over the chart
    -- The Mouse icon will change to "+" the zoom icon
    -- good
  4. Click and drag the mouse on the chart
    -- The chart will zoom in
    -- good
  5. Click the Restore toolbox button
    -- Both the chartand the toolbox buttons/icons will reset
    -- good
  6. Move your mouse over the chart
    -- Mouse icon is the "+" zoom icon
    -- bad
Current Behavior

The Restore toolbox button fails to fully restore when the Zoom button is pressed followed by pressing the Restore toolbox button

See the video listed below

https://github.com/user-attachments/assets/675eb9c7-339b-4f4c-86f4-8bd05ae9e6d1

Expected Behavior

After pressing the Restore toolbox button, the chart and the toolbox buttons and the mouse icon are all restored to the original defaults

Environment
- OS: N/A
- Browser:  N/A
- Framework:  N/A

This issue can be reduced with Echarts Demo Examples.  The issue is independent of my development environment or the browser used in testing.
Any additional comments?

This is a regression in ECharts 6.1.0. The restore feature worked properly in ECharts 6.0.0.

In addition, if you add a listener for the zoom action:

myChart.on('datazoom', (params) => {
console.log("data zoom params", params);
})

You can see that the restore button is not properly resetting zoom.

The video listed below shows the following:

1). Adding the zoom listener to the official echarts example demo
2) Repeating the following steps
-- click the zoom button, zoom in using the mouse, click the restore
3). Every time 2) is repeated, the zoom listener results in an incremental increase of multiple console output

https://github.com/user-attachments/assets/bcc7b260-a3bf-4187-be1b-cdfaf9442998

主要语言
TypeScript
星标
67.7k
派生
19.9k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/echarts 的其他 Issue

查看 apache/echarts 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。