views:

301

answers:

0

Given several flot objects on a page, each with the jquery.flot.crosshair.js plugin enable, how to I figure out which plot object has the labels I want to modify?

I am using the example code here: http://people.iola.dk/olau/flot/examples/tracking.html, but I have multiple flot objects per page.

Each seems to show the crosshairs just fine, but I cannot figure out how to get the updateLegend function to use something other than the 'plot' global variable.

Edit: found that javascript variable scoping allows me to have anonymous functions reference variables within scope where yjr function is defined. This allows me to pass in the url and other parameters to the $.get callback. Alas in my rewrite I am now passing large arrays by value (rather than by reference) and the slowdown is noticeable.

It feels real clumsy that the callback has no apparent reference to the original request.