apache / apache/echarts

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

Open
#20,871 3 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### 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

```markdown
- OS: any
- Browser: any
- Framework: any
```

### Any additional comments?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.