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
Legend item - on hover event #194
Comments
Hi @jmacioszek, Thank you for using Highcharts! You can do the same with our wrapper. You need to only get the chart reference:
Live example: https://codesandbox.io/s/highcharts-react-demo-of87n Best regards! |
I'm looking at doing something like this in a project, but with functional components. How would you go about setting this mouseover event in a functional component? |
Hi @nickbrinser, You just need to do the same, but in a slightly different way:
Here is an example: https://codesandbox.io/s/highcharts-react-demo-forked-fy2fw?file=/demo.jsx |
Thanks for the response @ppotaczek I was on the right track! |
This way will kill some of the default behavior, is there any other better way? |
Hi @104gogo, Which behavior do you mean? In the last example, you can see that the default mouseover behavior is kept. |
Hi @ppotaczek, Thanks for the reminder, now I know the problem is caused by setting But now there is a new problem, If Is there any way to solve this problem? |
Hi @104gogo, Thanks for more details! First of all, Secondary, depending on the
Adding the same event, on the same element by using the As a solution, you can add new events on
Live demo: https://codesandbox.io/s/highcharts-react-demo-fork-teh63d?file=/demo.jsx |
Hi @ppotaczek, Thank you very much for your tips, it gave me a lot of inspiration! After tried many times, I solved my problem and then completed the functional requirements. The code example:
Also modify the
Live demo: https://codesandbox.io/s/highcharts-react-demo-forked-pwwifb?file=/demo.jsx Finally thanks a lot! |
Is there a way to handle on hover event in legend item? It seems to be possible to access legend item in jquery and override such event:
serie.legendItem.on('mouseover', function(){))
Unfortunately I haven't found a way to do that in React. Any help much appriciated.
The text was updated successfully, but these errors were encountered: