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

Setting a container for the legend causes flot-hiddengraphs to not work

Open josephbisch opened this issue 10 years ago • 2 comments

Exactly what the title says. If I set a container for the legend flot-hiddengraphs stops working. If I don't set a container (the legend is inside the graph), it works fine. It was still working after I made my commit (April 2). Now it's not.

josephbisch avatar Jul 08 '14 18:07 josephbisch

Upon further inspection I have determined the source of the error. The following

var p = plot.getPlaceholder();

does not include the legend if you set an external container for the legend. If you revert to manually finding .graphlabel and .legendColorBox, it should work again as expected.

josephbisch avatar Jul 10 '14 14:07 josephbisch

Replace

var p = plot.getPlaceholder();

with

var p = (options.legend.container == null)?plot.getPlaceholder():$(options.legend.container);

EcoFreak avatar Dec 22 '14 17:12 EcoFreak