flot-hiddengraphs
flot-hiddengraphs copied to clipboard
Setting a container for the legend causes flot-hiddengraphs to not work
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.
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.
Replace
var p = plot.getPlaceholder();
with
var p = (options.legend.container == null)?plot.getPlaceholder():$(options.legend.container);