-
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
display tooltips only at points in chart area #10289
Conversation
src/core/core.interaction.js
Outdated
@@ -97,6 +97,10 @@ function getIntersectItems(chart, position, axis, useFinalPosition) { | |||
} | |||
|
|||
const evaluationFunc = function(element, datasetIndex, index) { | |||
const chartArea = chart.chartArea; | |||
if (element.x < chartArea.left || chartArea.right < element.x || element.y < chartArea.top || chartArea.bottom < element.y) { |
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 would use the _isPointInArea
helper function here.
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.
This seems to be the only issue here, @t-mangoe will you be able to update this PR?
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.
Oh, sorry. I noticed the comment, but have not yet updated it.
I will try to respond, so I hope you can wait.
(Or, I allow edits by maintainers, so it is ok that maintainers update this PR.)
I added code to display tooltips only at points in chart area.
This solves the issue of #10108