Reputation: 507
I need disable tooltip in google geo chart. I tried tooltip.trigger: 'none'
and other tries, but I can´t disable tooltip.
How to disable tooltip in google geo charts?
Thank You
Upvotes: 5
Views: 3746
Reputation: 336
To remove tooltip just add the below options:
var options = {
tooltip: { trigger: 'none'}
}
Full code:
var map_container = document.getElementById('map_div');
var options = {
tooltip: { trigger: 'none'}
}
var chart = new google.visualization.GeoChart(map_container);
chart.draw(data, options);`
Upvotes: 0
Reputation: 62773
Depending on what browsers your site/app need to support a simple CSS one-liner will disable interactivity.
#map {
pointer-events: none;
}
This will cause the map to appear as a static image with no interactivity. But again, it's not supported in all browsers.
Upvotes: 1
Reputation: 19644
According to asgallant on 12-09-12:
You can disable the tooltips by setting the option enableRegionInteractivity: false, which also disables clicking on regions. The API does not expose a mouseover event for the geo charts, so if you want to do your own, you will have to hook the mouse events on the SVG/VML manually. As far as I am aware, there is no good way to map an SVG/VML element to a DataTable element, though.
Upvotes: 0
Reputation: 5000
Had a look around and tried a few things but it seems that this particular bit of functionality is not part of Geo charts. With other charts, you can do the following and have tooltips disabled:
var options = {
tooltip {
trigger: 'none'
}
};
A workaround I came across is to create a div
that just sits on top of the map and that disables the interactivity of the map. Not the best solution but a work around until it's made available. You can see it working on jsfiddle.
Upvotes: 2