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

Clamp drag rectangle to chart area #896

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Nov 20, 2024

I believe this is a better UI, and it also fixes some issues with incorrect zoom ranges when dragging the rectangle outside of the chart area.

To help implement this, I copied the clamp helper function from chartjs-plugin-annotation.

Fixes #895

I believe this is a better UI, and it also fixes some issues with incorrect zoom ranges when dragging the rectangle outside of the chart area.

To help implement this, I copied the clamp helper function from chartjs-plugin-annotation.

Fixes chartjs#895
Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test would be good to prevent regressions in the future 🙂

@joshkel
Copy link
Contributor Author

joshkel commented Nov 21, 2024

@kurkle Done.

@joshkel joshkel force-pushed the drag-outside-chart-area branch from cf52bda to 293d472 Compare November 21, 2024 18:16
@joshkel joshkel force-pushed the drag-outside-chart-area branch from 293d472 to 36fe2c2 Compare November 21, 2024 18:17
@kurkle kurkle added the bug label Nov 21, 2024
@kurkle kurkle merged commit 2dabfe4 into chartjs:master Nov 21, 2024
11 of 12 checks passed
@joshkel joshkel deleted the drag-outside-chart-area branch November 21, 2024 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unwanted behavior when dragging outside of chart area
2 participants