Using GeoCharts is working great, but now I'm trying to figure out how to
handle the event listener.
I found some sample code for the eventData, but it's not exactly what I
want and I'm not finding the documentation for this piece of it in the API.
I may just be looking in the wrong place.
Two things to figure out.
1) How to ignore clicks on Countries not on the list, for example in the
data set below do nothing if clicking on Russia.
2) How to return the Country name, not the ISO code that google uses.
I'm sure I'm overlooking something obvious or just not reading the API
correctly so any help would be appreciated. Better yet, hints on where to
read more detail about the eventData for the GeoChart API..
Thanks,
David
var data = google.visualization.arrayToDataTable([
['Country', 'Presence'],
['Brazil', 2],
['Canada', 1],
['China', 1],
['United States', 5],
]);
google.visualization.events.addListener(geoChart, 'regionClick',
function(eventData)
{
alert('You clicked on a region named: ' + eventData.region);
});
--
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/-/yY10WczO6x0J.
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.