隐藏 Google Visualization API GeoChart 的工具提示

发布于 2024-12-28 10:16:14 字数 784 浏览 3 评论 0原文

我正在创建一个基于标记的 Geochart 来显示学校的位置。我的数据保存在 Google 文档电子表格中。我使用 3 列:纬度、经度和标记大小。目前,工具提示显示纬度和经度。理想情况下,它们会显示每所学校的信息,但删除它们也可以。看看我到目前为止在 jsfiddle 上有什么。

其他一些谷歌可视化似乎允许工具提示的触发器:“无”选项(例如,饼图)。我是否正确地认为 GeoChart 没有这样的东西?

似乎有一个实验性功能,允许将工具提示角色分配给特定的数据列。我尝试使用它但没有成功。

我尝试查找并隐藏工具提示 div,但我无法弄清楚如何访问包含地图的 iframe 中的任何元素。如果我能让这种解决方案发挥作用,我会非常高兴!

我意识到这并不完全是 Geochart 的用途,但我在同一页面上使用其他 Geochart 区域地图,并且希望保持相同的美感。

I am creating a markers-based Geochart to display the location of schools. I have my data in a Google docs spreadsheet. I'm using 3 columns: lat, long and marker size. Currently, the tooltips display lat and long. Ideally, they would display information about each school instead but removing them would be fine, too. See what I have so far on jsfiddle.

Some of the other Google visualizations seem to allow a trigger:'none' option for tooltip (e.g., Pie Chart). Am I correct that there is no such thing for GeoChart?

It seems there's an experimental feature that allows assigning a tooltip role to a particular data column. I tried to use that to no avail.

I tried finding and hiding the tooltip div but I couldn't figure out how to access any elements in the iframe that contains the map. I'd be perfectly happy with this kind of solution if I could get it to work!

I realize this is not exactly what Geochart seems meant for but I'm using other Geochart region maps on the same page and would like to keep the same aesthetic.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

束缚m 2025-01-04 10:16:14

我知道这是一个老问题,但也许它仍然有帮助。

查看此示例:

data.addColumn('number', 'Lat');                                
data.addColumn('number', 'Long');
data.addColumn('string','tooltip');
data.addColumn('number','Example');                                 

data.addRows([[41.151636,-8.569336,'Portugal',{v:0,f:'test PT'}]]);
data.addRows([[ 39.059575,-98.789062,'USA',{v:1,f:'test US'}]]);

您现在还可以禁用工具提示添加,这在以前是不可用的:

tooltip.trigger:'none';

这是一个示例: http ://jsfiddle.net/cmoreira/njB6m/

I know this is an old question, but maybe it can still help.

Check out this example:

data.addColumn('number', 'Lat');                                
data.addColumn('number', 'Long');
data.addColumn('string','tooltip');
data.addColumn('number','Example');                                 

data.addRows([[41.151636,-8.569336,'Portugal',{v:0,f:'test PT'}]]);
data.addRows([[ 39.059575,-98.789062,'USA',{v:1,f:'test US'}]]);

You can now also disable the tooltip adding, which was not previously available:

tooltip.trigger:'none';

Here is an example: http://jsfiddle.net/cmoreira/njB6m/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文