-
Notifications
You must be signed in to change notification settings - Fork 715
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
Event handlers on pie charts? #199
Comments
Hi @erosenberg, thanks for checking out vx! Yes, events on a pie chart are possible. demo: https://codesandbox.io/s/mjp8lmvop?expanddevtools=1 the important bit: <Pie
// ...
onMouseEnter={data => event => {
console.log("mouse enter", data.data.letter);
}}
/> |
This worked excellently. Thanks, @hshoff ! Was that that somewhere in the docs and I just missed it? |
Any possibility we can get an updated example? I'm trying to do exactly as above but my Here's a demo: https://codesandbox.io/s/jolly-burnell-uxzh7?file=/src/App.js |
@libnine sure thing, here ya go: https://codesandbox.io/s/strange-lehmann-vdoff?file=/src/App.js |
Thank you so much Harrison! |
References: https://codesandbox.io/s/mjp8lmvop?expanddevtools=1&file=/index.js airbnb/visx#199 Notes: - Tested using data => event => function pattern without any luck on <Pie /> component. - Ended up using useEffect with setTimeout to hide the tooltips. - Moved useIntersectionObserver to hooks folder - Changed legend item classes to use an array and placed the legend text as a class
References: https://codesandbox.io/s/mjp8lmvop?expanddevtools=1&file=/index.js airbnb/visx#199 Notes: - Tested using data => event => function pattern without any luck on <Pie /> component. - Ended up using useEffect with setTimeout to hide the tooltips. - Moved useIntersectionObserver to hooks folder - Changed legend item classes to use an array and placed the legend text as a class
Hello, just wanted to know if it's possible to add event handlers to pie charts. Essentially, I want a label elsewhere on my page to update when I hover over a specific data set. Is this possible? I can work around it, but it would be nice functionality to have if not there already. #
The text was updated successfully, but these errors were encountered: