apache / apache/echarts

dispatchAction dataZoom should also update the zoom stack used by the toolbox 'zoom reset'

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

Description

### Version
4.8.0

### Steps to reproduce
1. Have a scatter chart with toolbox dataZoom for manual x,y zooming enabled.
2. Do a manual zoom using the toolbox
3. Do a programmatic zoom (e.g. by click on chart) by dispatch a zoom action like so:

```js
chart.dispatchAction({
type: "dataZoom",
dataZoomIndex: 0,
start: 25,
end: 50,
});
```

### What is expected?
All zoom operations, whether triggered manually through the toolbox or programmatic by `dispatchAction()` should go to the same zoom stack. This is to have consistent behavior of the **zoom back** option of the toolbox. It should step back to all zooms, whether manually set or programmatic dispatched.

### What is actually happening?
This works, however it does not put the zoom operation on the _zoom stack_ that is used by the toolbox **zoom back** item.
This gives a nasty user experience when having both, manual zoom by toolbox and programmatic zoom mixed.
When then using the 'zoom back' option from the toolbox, it only recognizes the manual zooms.

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.