Skip to content

Fix one-sided-zoom #2380

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
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

DrNiels
Copy link

@DrNiels DrNiels commented Jun 20, 2025

Based on issue #2354, I decided to dive deeper and found the culprit. The issue happens, when adjusting the visible range of an axis via RangeController and leaving one side as is. In that case, the visible range is updated to the actual min/max for the side that should remain equal.

As far as I understood the source code: _updateZoomFactorAndPosition gets the updated min and max as input. If a value does not change, it is given as null. Based on the new values, the new zoom factor and position are determined. In the current implementation, the fallback for null, i.e., nothing should change, is the actual min/max, leading to the visible range jumping to 2000 in the example from the issue. As the zoom is based on the visible range, that should be used as fallback instead, which is what I did in this PR.

I tried my best, but I'm still foreign to your personal coding practices, so feel free to remark anything and I will adjust the code accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charts Charts component open Open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants