Better yet, put this in after you call the draw method (otherwise the chart
might not finish drawing before this is called, and jQuery could throw an
error):
/* assumes that chart is your chart object
* hooks the 'click' event of the chart div's iframe's body element
* interpolates the mouse coordinates into chart values
* adds them to the chart and redraws the chart
*/
google.events.addListener(chart, 'ready', function () {
$("#chart_div").find("iframe").contents().find("body").click(function(e
) {
// get X and Y coordinates in the chart
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
/*
* transform coordinates into chart values
* and insert into data table object
*
* redraw the chart with new data
*/
});
});
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/zRTsQAAWn64J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.