flot-hiddengraphs
flot-hiddengraphs copied to clipboard
legend.hidden option not working correctly
Seems that only ever second element of legend.hidden results in the series being hidden by default.
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
+1
Thanks for that fix, it does the job.