Skip to content

Showing external tooltip on legend hover issue #9842

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

Closed
peteruithoven opened this issue Nov 11, 2021 · 1 comment · Fixed by #9970
Closed

Showing external tooltip on legend hover issue #9842

peteruithoven opened this issue Nov 11, 2021 · 1 comment · Fixed by #9970

Comments

@peteruithoven
Copy link

Expected Behavior

When I use tooltip.setActiveElements on legend.onHover and I'm using an external tooltip, it should show the tooltip.

Current Behavior

The externalTooltip handler is called, which would render the tooltip, but then it's immediately called a second time, where the second time the tooltip.opacity is 0.

Steps to Reproduce

Example: https://codepen.io/peteruithoven/pen/qBXMBNx?editors=0010
Hover over legend items, no tooltip will appear.
(console.log will show external tooltip function calls)
Initial setActiveElements and regular pie chart hovering does show tooltip.

Context

We sometimes have charts with very low values, so we need an additional way to show the tooltip.

Environment

  • Chart.js version: 3.5.1
  • Browser name and version: Firefox
@peteruithoven
Copy link
Author

Looking into the Chart.js tooltip code it seems to call afterEvent, which calls handleEvent which calls update, which calls extenal.

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

Successfully merging a pull request may close this issue.

2 participants