Flotr and Plotr are actually very good libraries for plotting graphs and pie charts. The problem I am having is that events are only supported in flotr and pie charts are only supported in plotr. I am going to attempt to rewrite plotr to allow event handling. Ill report back if Im successful.
if it uses a canvas, you could do a trick i used on a color-picker script.
i had a nice image of a full-color spectrum.
i took the coords from the canvas onclick event and matched the corresponding pixel from the canvas's context's imageData.
i then had the RGB value of the color they clicked on.
if it doesn't use canvas, it probably uses a bunch of tiny HTML elements, and you can easily bind events to these.
using something comparable, i would think it easy to match a color to a category, and launch the apropos action.
this means you don't have to dive into the rendering code.
if it doesn't use canvas, it probably uses a bunch of tiny HTML elements, which you can easily bind events to.