How to disable tooltip in google geo chart?

谁说胖子不能爱 提交于 2020-01-30 04:55:20

问题


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


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/11080331/how-to-disable-tooltip-in-google-geo-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!