Skip to content

display tooltips only at points in chart area#10289

Merged
etimberg merged 3 commits into
chartjs:masterfrom
t-mangoe:issue10108
May 7, 2022
Merged

display tooltips only at points in chart area#10289
etimberg merged 3 commits into
chartjs:masterfrom
t-mangoe:issue10108

Conversation

@t-mangoe

@t-mangoe t-mangoe commented Apr 9, 2022

Copy link
Copy Markdown
Contributor

I added code to display tooltips only at points in chart area.
This solves the issue of #10108

@LeeLenaleee LeeLenaleee added this to the Version 3.8.0 milestone Apr 11, 2022
@etimberg
etimberg requested a review from kurkle April 16, 2022 14:03
Comment thread src/core/core.interaction.js Outdated

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) {

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Contributor Author

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants