niv123
Posts: 19
Joined: Tue Jun 01, 2021 9:28 pm

Negative stack bar chart- Removing dimming behavior on hover

Hi,
I want to remove the dimming behavior on hover of the chart for the below Negative stack bar chart
https://jsfiddle.net/5jqnv6fy/2/
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Negative stack bar chart- Removing dimming behavior on hover

Hi!
this code snippet should do the trick:

Code: Select all

 plotOptions: {
        series: {
            states: {
                hover: {
                    enabled: false
                }
            }
        }
    },
https://jsfiddle.net/BlackLabel/czf32e4b/

Kind regards,
Paweł Lysy
Highcharts Developer
niv123
Posts: 19
Joined: Tue Jun 01, 2021 9:28 pm

Re: Negative stack bar chart- Removing dimming behavior on hover

Hi, Thanks for your response.
But could you try it in the stacked pyramid chart with negative stack. The jsfiddle link that i have added. The hover -enabled - false does not work on that one. Kindly help me with that
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Negative stack bar chart- Removing dimming behavior on hover

Hi! If you want to preserve the hover effect on series, but disable the dimming effect on other series, you can overwrite the inactive state. Check the following demo: https://jsfiddle.net/BlackLabel/permhcL4/

Let me know, if that works for you, and in case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer
niv123
Posts: 19
Joined: Tue Jun 01, 2021 9:28 pm

Re: Negative stack bar chart- Removing dimming behavior on hover

Hi Pawleys,
Thanks so much for your response. This works!
Is it possible that when I even hover on a particular bar, at that also the dimming effect comes, can that also be removed?
Please help!
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Negative stack bar chart- Removing dimming behavior on hover

Hello again! As you can find in our official API reference: https://api.highcharts.com/highcharts/s ... ates.hover

There are numerous styles for each state of the point (hover, inactive, etc). You can overwrite each state, so that it behaves just like you want it. Give it a go, and in case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer
niv123
Posts: 19
Joined: Tue Jun 01, 2021 9:28 pm

Re: Negative stack bar chart- Removing dimming behavior on hover

Pawleys!! Thanks so much! It worked :)
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Negative stack bar chart- Removing dimming behavior on hover

You're welcome! In case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer
niv123
Posts: 19
Joined: Tue Jun 01, 2021 9:28 pm

Re: Negative stack bar chart- Removing dimming behavior on hover

Thanks pawleys!
1 question, is it possible that I can have hover behaviour on legends(that reflects in the bar chart) but not on bar hover in this chart
https://jsfiddle.net/5vyLao19/2/
So basically we have made the opacity as 1 on hover of the bars, but when i hover on the legends, then also the series do not get highlighted like in this https://jsfiddle.net/5vyLao19/3/

Basically i want both the behaviour, no hover on bars but it should work when i do so on legends
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: Negative stack bar chart- Removing dimming behavior on hover

Hi! You can set the opacity of the series by adding the onmousein event on legend item. This should overwrite the current state of the point, and let you adjust the visual representation of the column. Let me know, if that works for you, and in case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer

Return to “Highcharts Usage”