That is an interesting idea. I suspect that you could make it work by
hooking the "click" event of the "body" element inside the chart's iframe.
If you interpolate the mouse position into chart coordinates, you can add a
point to the DataTable object and redraw the chart. ScatterCharts would
probably work best for this, as line charts will draw evenly spaced data
points.
You'd need a way to hook into the iframe's contents (I find jQuery is best
for this). You can use this as a basis:
$("#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'll need to custom code your own function to interpolate the coordinates
into data. Put this in your draw function *after* you draw the chart the
first time.
--
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/-/9T7CtukMZpoJ.
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.