flot-hiddengraphs icon indicating copy to clipboard operation
flot-hiddengraphs copied to clipboard

legend.hidden option not working correctly

Open markrcote opened this issue 10 years ago • 2 comments

Seems that only ever second element of legend.hidden results in the series being hidden by default.

markrcote avatar Nov 23 '14 00:11 markrcote

Below line 204, add the following line:

options.legend.hidden.splice(options.legend.hidden.indexOf(s.label), 1);

.. So the new block of code will read:

if (off) {
    s.oldColor = s.color;
    s.color = "#fff";
    options.legend.hidden.splice(options.legend.hidden.indexOf(s.label), 1);
}

When initially rendering the graph, this removes each hidden option as it processes it. Without this, the process can trigger multiple times, leading to a series being turn off and then back on again

DrummerSi avatar Feb 02 '15 13:02 DrummerSi

+1

Thanks for that fix, it does the job.

laufhannes avatar Feb 19 '16 12:02 laufhannes