Skip to content

[Bug] Zoom back button doesn't work after dataZoom action #20871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NichitaD opened this issue Mar 27, 2025 · 3 comments
Open

[Bug] Zoom back button doesn't work after dataZoom action #20871

NichitaD opened this issue Mar 27, 2025 · 3 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@NichitaD
Copy link

Version

5.6.0

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/large-scale-area-chart-forked-cdmych?file=/index.js:80,20

Steps to Reproduce

  1. Configure any type of chart with the toolbox enabled
  2. Programatically set a new zoom range using dispatchAction({ type: 'dataZoom', ... })
  3. Try clicking on the Zoom Back button in the toolbox

Current Behavior

The zoom back button isn't working after programatically updating the zoom range.

Expected Behavior

Programmatic zoom changes using dispatchAction({ type: "dataZoom" }) should be added to the zoom history. The zoom back button should be enabled and allow stepping back to the previous zoom state, just like when the user manually interacts with the zoom controls..

Environment

- OS: any
- Browser: any
- Framework: any

Any additional comments?

No response

@NichitaD NichitaD added the bug label Mar 27, 2025
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Mar 27, 2025
@helgasoft
Copy link

zoom changes using dispatchAction({ type: "dataZoom" }) should be added to the zoom history

Would be a nice new feature indeed. Until implemented, zoom reset will have to be done by dispatchAction from another custom button.

@MatthiasMert
Copy link

MatthiasMert commented Mar 28, 2025

As a workaround you can also implement the zoomReset button as a user-defined tool.

Example small

Example given

@NichitaD
Copy link
Author

Thanks, will use the workaround until the feature is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

3 participants