FabriPetrelli
Posts: 14
Joined: Thu Nov 12, 2020 9:39 am

Change color onHover of another component

Hi,

I was wondering if it's possible to change the color of a specific county when I hover the county name in another component.

In other words I have in a div:
  • a component that displays all the county name of the map
  • the highcharts map component
and I want to change the color of the specified county when I hover it in the list.
Is it possible?
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Change color onHover of another component

Hello FabriPetrelli!

Thanks for contacting us with your question!

We can achieve this effect using mouseOver event on each point of the series. Is that what you are looking for?

API references:
https://api.highcharts.com/highmaps/ser ... .mouseOver
https://api.highcharts.com/class-refere ... int#update

Demo:
https://jsfiddle.net/BlackLabel/av4qy86d/

Best regards!
Dominik Chudy
Highcharts Developer
FabriPetrelli
Posts: 14
Joined: Thu Nov 12, 2020 9:39 am

Re: Change color onHover of another component

dominik.c wrote: Wed Dec 16, 2020 1:02 pm Hello FabriPetrelli!

Thanks for contacting us with your question!

We can achieve this effect using mouseOver event on each point of the series. Is that what you are looking for?

API references:
https://api.highcharts.com/highmaps/ser ... .mouseOver
https://api.highcharts.com/class-refere ... int#update

Demo:
https://jsfiddle.net/BlackLabel/av4qy86d/

Best regards!
I'm already using the series>states>hover function, I was wondering if it's possible that whenever I hover a country change also the color of the name of the country in my list which is a separate component and viceversa
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Change color onHover of another component

Hi again!

We could do it for sure using elements from Highcharts, but I think it's manageable to do that with a separate component. But firstly could you share your demo with us? Then I could take a closer look at it and test some ideas. :)

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Maps”