magistr4815
Posts: 10
Joined: Mon Dec 16, 2019 1:52 pm
Contact: Website Skype YouTube

Change line transparency when clicking on a legend item

Hello everybody.
I'm trying to figure out if there is any standard functionality for my idea.

I want that when clicking on the legend element, the line does not disappear completely, but becomes transparent.

I found a way like this:
When I click on the legend item, I intercept the event and simply change the color of the series (its state remains enabled).

Are there any other ideas?
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Change line transparency when clicking on a legend item

Hello magistr4815!

We appreciate you reaching out to us!

To be honest, no there aren't. Your idea is the simplest and the best one. The only thing you could change is no to update the color of the series but its opacity.

API references:
https://api.highcharts.com/highcharts/s ... ne.opacity

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”