Skip to content
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

Changing zoom mode (drag) resets the zoom level #814

Open
francescopenna opened this issue Apr 17, 2024 · 0 comments
Open

Changing zoom mode (drag) resets the zoom level #814

francescopenna opened this issue Apr 17, 2024 · 0 comments

Comments

@francescopenna
Copy link

francescopenna commented Apr 17, 2024

I am using a chart with this zoom configuration (pan is disabled):

zoom: {
  zoom: {
    mode: "xy",
    drag: {
      enabled: true,
      treshold: 100,
      drawTime: "afterDatasetsDraw",
    },
  }
}

I noticed that after a first zoom if I try to change the mode, for example with chart.config.options.plugins.zoom.zoom.mode = "y", the mode is succesfully changed, but the zoom level gets resetted.
I made a sandbox showcasing this issue. In the example, try to change the zoom mode, zoom out, then change the zoom mode again to see the issue.
Is this intended? And if so, is there a workaround for this?
Thanks in advance

@francescopenna francescopenna changed the title Changing zoom mode resets the zoom level Changing zoom mode (drag) resets the zoom level Apr 23, 2024
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

No branches or pull requests

1 participant