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

Fix zoom outside of chart area #811

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gopal-panigrahi
Copy link

@gopal-panigrahi gopal-panigrahi commented Mar 17, 2024

Fix: #770
Fix: #807

Changes:

  1. Attaches mousemove event to canvas.ownerDocument for calculating drag rectangle even when cursor is outside the chart area.
  2. checks if endpoint of drag rectangle is outside the chart area then endpoint is calculated based on clientX/Y - chartArea.left/top
  3. clips drag rectangle to the chart area.

@gopal-panigrahi
Copy link
Author

Hi @kurkle,
Please can you review the PR.

@zloveless
Copy link

Hi @gopal-panigrahi
I believe this would fix an issue we're having in our charts. Is there any portable solution I can try on my end to see if it works?

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.

Chartjs-plugin-zoom drag issue Drag to the outside of the chart doesn't work correctly
2 participants