Re: GeoChart: Remove "Region color" value from region tooltip

599 views
Skip to first unread message

asgallant

unread,
Jul 26, 2012, 5:24:49 PM7/26/12
to google-visua...@googlegroups.com
There is no way to turn off the value in the tooltip, but you can override the tooltips with your own contents using a "tooltip" column role.

On Thursday, July 26, 2012 4:40:44 PM UTC-4, Dan Poynor wrote:
I'm using the region format and only want the country name (region location) to appear in the tooltip on rollover.

Instead I'm getting both the region location and the region color value.

This option will make the tooltip color red, but the color code value still appears:
tooltip: {textStyle: {color: 'red'}, showColorCode: false}

Thanks,
DAN

Dan Poynor

unread,
Jul 26, 2012, 5:41:35 PM7/26/12
to google-visua...@googlegroups.com
Thanks for the info.

Is there info on how to add a column role to the GeoChart?

The DataTable Roles page says "each chart's documentation will describe which roles are available" and no roles are listed on the Geo Charts page.

asgallant

unread,
Jul 26, 2012, 6:17:24 PM7/26/12
to google-visua...@googlegroups.com
Set up a third column in the DataTable, type "string" and role "tooltip", then add a third column of data, which you probably want to be all null, something like this:

var data new google.visualization.DataTable();
data.addColumn('string''Foo');
data.addColumn('number''');
data.addColumn({type'string'role'tooltip'});
data.addRows([
    ['Germany'200''],
    ['United States'300''],
    ['Brazil'400''],
    ['Canada'500''],
    ['France'600''],
    ['RU'700'']
]); 

Dan Poynor

unread,
Jul 26, 2012, 8:11:23 PM7/26/12
to google-visua...@googlegroups.com
Awesome - thanks!
Reply all
Reply to author
Forward
0 new messages