Default legend color problem

Hi,

I am working on my plots and I saw behavior I want to eliminate. I plot four different colors and there is dropdown to choose which groups should be highlighted on red. However, when picking the first group, legend color turns also in red. I suppose it is caused by default picking first sample on the plot as a reference legend color, because when i change selection to every other group than first one, legend color comes back to expected.

First plot shows the first sample picked from dropdown and as you can see, whole legend is red, and the second plot shows situation when every other sample is picked and legend color is now as it should be.

My question is: is there a way to hardcode legend color to not be dependent on first sample occurrence? I could not find this in API, so if there is any documentation about this in internet, then I would be glad if you can leave me a link.


Plot 1 - First sample selected on dropdown and whole legend is red


Plot 2 - Other sample selected on dropdown and whole legend is as it should be