markrcote/flot-hiddengraphs

Dynamic Hidden Field not working

Opened this issue · 0 comments

Using a variable in the hidden property doesn't work properly.
It only uses the first label that is found in the varible, or even a string, unless specificly changed with toString(), but this breaks the hiddengraphs functionality.
even using hidden: "label1", "label2" directly doesnt work, only label1 then hidden.

example:
var SelectedLegendTemp= ["label1", "label2"]

multigraphVarible = $.plot($("#graph"), plotdata, {
grid: { show: true, hoverable: true, clickable: true },
xaxis: { mode: "time", timezone: "browser", min: view.start, max: view.end },
selection: { mode: "x" },
legend: {
position: "nw",
hideable: true,
hidden: SelectedLegendTemp
}
});