nixor78
Posts: 9
Joined: Thu May 13, 2021 8:51 am

Legends: Not change colour of text on click

Hi,

I have a query regarding the icon part of the legends.
legends.jpg
legends.jpg (6.51 KiB) Viewed 264 times
In this image you can see there are 4 legends. The 2nd legend is inactive (clicked on it to inactivate it).
When I do this I don't want the text part of the legend to change colour but the icon should be greyed out. How can I achieve this?
I am using scss to do the colour coding.

Thanks.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Legends: Not change colour of text on click

Hi nixor78,

Thanks for contacting us with your question.

Please try to add this piece of code to your css and let me know if it works:

Code: Select all

.highcharts-legend-item-hidden>text {
  fill: #333333 !important;
}
Demo: https://jsfiddle.net/BlackLabel/fcu7tnrp/

Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”