I needed the jqplot events described here so I made these changes. I don't know how to test this more thoroughly...
Hope this is useful for somebody else as well.