appending custom javascript

Hello there,

i would like to know if it is possible to use the hover tool in a context of an image graph ( and set the value of columns to a result of an on the fly generated JavaScript function .

I want to do this to avoid pushing all the labels into the JavaScript because this tends to slow things down in case of a big image.

Thanks a lot