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

onHover is not working with bar chart #11987

Open
karthik-noveau opened this issue Jan 3, 2025 · 1 comment
Open

onHover is not working with bar chart #11987

karthik-noveau opened this issue Jan 3, 2025 · 1 comment

Comments

@karthik-noveau
Copy link

Expected behavior

need to set custom pattern effect on hover on each bar

Current behavior

onHover is not working

Reproducible sample

https://github.com/karthik-noveau/chart-js

Optional extra steps/info to reproduce

npm install
npm start
hover on bar chart

Possible solution

No response

Context

i'm trying to add the pattern effect on hover each chart ( pie, dounghnut, bar, area line, bubble )

chart.js version

4.4.7

Browser name and version

chrome Version 131.0.6778.205

Link to your project

https://github.com/karthik-noveau/chart-js

@LeeLenaleee
Copy link
Collaborator

You have the function in the wrong spot, in the pie chart you have it in the root of the options object but in the bar chart you have placed it in the hover section.

The hover section is just for some configuration and not for the actual onHover method. So if you take it out of there it works normally

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