-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Limit onClick to chartArea #6227
Conversation
It may be better to handle click events in |
That would fire |
Currently, click events are picked by legend's On the other hand, click events on the legend cause a few problems as reported, I think this change (interception of click events by legend's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this probably makes sense. Users can add their own onClick
to the canvas fairly easily if that's what they want.
Not a main consideration, but this PR would improve usability of the zoom plugin chartjs/chartjs-plugin-zoom#205
I'm worry that there are existing implementations that listen for this click events and do hit test with scale elements or the title (e.g. open a "link"). I agree with @nagix, this is here since a very long time and I'm pretty sure it will break some projects. |
Closes: #6044
Demo