Crosshair plugin not updating legend after resize - conflict with resize plugin. #1191

js1972 opened this Issue Nov 15, 2013 · 1 comment


None yet
2 participants

js1972 commented Nov 15, 2013

I think there is a conflict between the crosshair plugin and the resize plugin as after a window resize the crosshair plugin no longer updates the legend with the values.

Please see this jsbin for an example:

I have just copied the provided flot example of using the crosshairs, but added the auto resize plugin as well - had to adjust the containing div's css to allow resizing.

Now move the cross hairs to get some numbers in the legend. No resize the window and you will never be able to get the legend values back again. In fact the legend updates seems to be completely disable if a window resize event occurs.

I've tried adding new calls to plot() and setupGrid() in appropriate spots to no avail.



dnschnur commented Nov 16, 2013

The bug is due to the way you're saving the legend divs:

var legends = $("#placeholder .legendLabel");

Redraw re-generates the legend, so this reference no longer points to what's actually on the page. If you re-acquire the legends within your updateLegend function, then it works.

dnschnur closed this Nov 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment