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 not working #12

Open
mturnwall opened this issue Oct 3, 2018 · 2 comments
Open

onHover not working #12

mturnwall opened this issue Oct 3, 2018 · 2 comments

Comments

@mturnwall
Copy link

Hi, I'm trying to use this for an interactive radar chart. It has all functionality I need. Unfortunately the onHover method isn't working for me. I tried using your exact code from your example in the README.

Here is an example of what I'm doing, https://codesandbox.io/s/r0j22wl76p

@shauns
Copy link
Owner

shauns commented Oct 5, 2018

Hi @mturnwall ! I have forked your sandbox and made two changes that sort things out:

Firstly I downgraded to the non-RC version of the repo. It's still WIP and has some issues around internal SVG transforms and mapping to hovered points.

I also changed how you've used the highlighted prop. It's a controlled component, so you have to tell it what point to highlight. So the flow is: user moves over a point > onHover prop called > you do something with that -- typically setting state like I've done in the sandbox > you update other props, like highlighted.

I hope that helps!

Do you mind me asking what you're working on?

@shauns
Copy link
Owner

shauns commented Oct 5, 2018

The link would be useful too :D https://codesandbox.io/s/94zyqrly8p

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

No branches or pull requests

2 participants