Skip to content

Add mouse wheel zoom support for Y-axis#798

Merged
liihuu merged 3 commits into
klinecharts:mainfrom
gt-core:os/y-axis-zoom
Jul 1, 2026
Merged

Add mouse wheel zoom support for Y-axis#798
liihuu merged 3 commits into
klinecharts:mainfrom
gt-core:os/y-axis-zoom

Conversation

@ashutosh-trader

Copy link
Copy Markdown
Contributor

Summary

Add support for zooming the Y-axis using the mouse wheel, allowing users to quickly adjust the vertical scale without dragging.

Changes

  • Add mouse wheel zoom handling for Y-axis widget in mouseWheelVertEvent
  • Extract Y-axis zoom logic into reusable _zoomYAxis private method
  • Reuse the same zoom logic for both drag-to-scale and scroll-to-zoom interactions

Behavior

When the mouse is over the Y-axis and scrollZoomEnabled is true:

  • Scrolling up zooms in (decreases range)
  • Scrolling down zooms out (increases range)

This matches the existing zoom behavior on the main chart area and provides a more intuitive way to adjust the Y-axis scale.

@ashutosh-trader

Copy link
Copy Markdown
Contributor Author

closed PR #787 to add mouse wheel / touch scroll support

@ashutosh-trader

Copy link
Copy Markdown
Contributor Author

@liihuu please review this , I have tested this to be working fine using both mousewheel and touchbar

@liihuu liihuu merged commit 8c367f0 into klinecharts:main Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants