[geochart] how to replicate on mouse hover behaviour (focus and tool-tip elaboration) ?

703 views
Skip to first unread message

Alvaro Fernández Seco

unread,
May 29, 2014, 6:44:24 AM5/29/14
to google-visua...@googlegroups.com
Hello, 

i'm using a geochart to enhance visualization of data contained in a table. This table has a row for each geochart's region which has available data.

Normal behaviour of geochart, when user's mouse hovers over any region is to focus that region and show a tool tip, right?

I want to replicate this behaviour not only in these situations, but also when users click on each table row.

I've tried with:

    geoChart.setSelection([{row: rowID, column: comunID}]);

or even with:

    google.visualization.events.trigger(geoChart, 'onmouseover', {regionID'});

but none of this is working. Triggering the 'onmouseover' event is working, as I am able to catch it up later with:
   google.visualization.events.addListener(geoChart, 'onmouseover', onMouseOverGeoChart);
but the geochart does nothing (no focus on that region, no tooltip neither).

which is the event fired when an user moves his mouse over a geochart region? how can we fire that event at our will?

Any idea? Any tips will be highly appreciated. Regards.

Andrew Gallant

unread,
May 29, 2014, 9:30:31 AM5/29/14
to google-visua...@googlegroups.com
The mouseover event fires when a user mouses over a region, but you can't trigger the tooltip with that.  Setting the selection should work if you set the GeoChart's tooltip.trigger option to "selection".

Alvaro Fernández Seco

unread,
May 29, 2014, 12:34:20 PM5/29/14
to google-visua...@googlegroups.com
hm... after configure geochart options with
tooltip: {trigger: 'selection'} 

the tooltip is still showing up when just hovering over any region ( if i set trigger: 'none' tooltip is not displayed).

beyond this, I think I'm doing something wrong with setSelection() because no changes are shown in geochart after calling it:

isn't the geoChart supposed to focus on the region linked to row 2, and show the tooltip after executing:

geochart.setSelection([{row: 2, column: null}])

¿?
http://jsfiddle.net/_alatriste_/jXPJ8/

Andrew Gallant

unread,
May 29, 2014, 8:43:50 PM5/29/14
to google-visua...@googlegroups.com
Looks support for the "selection" value for tooltip.trigger hasn't made it to production yet.  You can load the release candidate version (1.1) instead of the production version (1) until the next release comes out to use this feature.  Ex: http://jsfiddle.net/asgallant/jXPJ8/6/

Alvaro Fernández Seco

unread,
May 30, 2014, 3:40:20 AM5/30/14
to google-visua...@googlegroups.com
Perfect! Thx a lot [Graciñas :D]
Reply all
Reply to author
Forward
0 new messages