GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Original author: changos...@gmail.com (August 14, 2012 19:07:51)
allow direct, arbitrary access to the 'eventHolder' canvas object
currently, it is a somewhat clumsy task to try to get the 'eventHolder' object:
hack into the flot source code & manually expose it:
use the 'bindEvents' hook to 'grab&save' a reference to the object:
//do stuff with eHolder, since it should now be defined
//reason this might be necessary is for 'delayed/postponed event binding&unbinding'
//i.e., cases where you dont want or cant define event handlers using the 'bindEvents' hooks
manually try to 'select' the eventHolder object (which is ugly & might be unreliable?)
var eventHolder=$("#plot_div canvas.overlay");
add a simple 'getter' function that returns the internal 'eventHolder' canvas object;
For event-binding safety, I guess you could do a simple internal test to see 'bindEvents' has already been executed, and return 'false' if not; otherwise, return the canvas obj. But realistically, I dont think this would be a problem. thoughts/feedback?
Original issue: http://code.google.com/p/flot/issues/detail?id=738