fix(Datazoom): sideway scrolling & zooming disproportion
Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
What does this PR do?
This PR fixes some zoom issues in DataZoom
Fixed issues
- Fixed sideway scrolling when reaching max or min span in DataZoom
- Fixed zooming disproportion in DataZoom if there is more than one axis (keep the same ratio for x and y axis)
Details
Before: What was the problem?
-
When using mouse wheel to zoom in/out, it will start sideway scrolling when it reaches the max/min span.
-
Sometimes on zoom out, the zoom ration will become inconsistent and causing a disproportional view.
After: How does it behave after the fixing?
-
Fixed effect: it will stop at the max/min span
-
Fixed effect: Two axes keep the same ratio
Document Info
One of the following should be checked.
- [x] This PR doesn't relate to document changes
- [ ] The document should be updated later
- [ ] The document changes have been made in apache/echarts-doc#xxx
Misc
ZRender Changes
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
- [x] Please squash the commits into a single one when merging.
Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20124@d08b02b
Hi @Ovilia , sorry for the late reply.
It's how to reproduce: When you zoom in, drag the view over to a side and zoom out, if a side touches the boundary faster than another, it will happen. It's subtle but it does happen. Our PM was unhappy about the result so we have to use our custom code base. I really hope it can be merged so we can come back to the office release branch.
Cheers, Kevin