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

Tooltip is not registered properbly if loaded as plugin #11691

Closed
CordlessWool opened this issue Feb 28, 2024 · 2 comments
Closed

Tooltip is not registered properbly if loaded as plugin #11691

CordlessWool opened this issue Feb 28, 2024 · 2 comments

Comments

@CordlessWool
Copy link

Expected behavior

As a plugin I expect, that I could load as a plugin per compnentn and do not have to use Chart.register

Current behavior

Default tooltip is not displayed if registered as plugin. If I add a custom Tooltip it will displayed. The default tooltip is only displayed if I add it with Chart.register

Reproducible sample

https://codesandbox.io/p/devbox/react-chartjs-2-chart-js-issue-template-v4-forked-mdczmz?file=%2Fsrc%2FChart.tsx%3A14%2C31&workspaceId=8c9977f2-c083-4e1b-8fe6-12fa4a16c29b

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

v4.4.2

Browser name and version

Firefox 123

Link to your project

https://github.com/cotton-coding/loom-ui

@LeeLenaleee
Copy link
Collaborator

The tooltip plugin uses an hook that only fires once after the chart has been made to create its own tooltip object. This is why the plugin needs to be registered.

@LeeLenaleee
Copy link
Collaborator

Closing as per my above comment, inline registration does not work because it needs specific hooks.

If you don't want to tooltip on all charts you can disable it in the options by setting options.plugins,tooltip: false

@LeeLenaleee LeeLenaleee closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants