从 Google 可视化饼图(核心图表)中删除悬停工具提示

发布于 2024-12-17 06:57:01 字数 240 浏览 5 评论 0原文

如何从 Google 可视化饼图(核心图表)中删除悬停工具提示?需要使其跨浏览器工作,例如 IE、FF、Chrome、Safari、Opera

在此处输入图像描述

编辑:我也需要切片可点击。
enableInteractivity : false 删除悬停,但不会引发“选择”或其他基于交互的事件。

How to remove hover tooltip from Google Visualization pie chart (core chart)? Need to make it work cross-browser, eg, IE, FF, Chrome, Safari, Opera

enter image description here

Edit: I need the slices to be be clickable too.
enableInteractivity : false removes the hovers but doens't throw 'select' or other interaction-based events.

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

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

发布评论

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

评论(4

装纯掩盖桑 2024-12-24 06:57:01

也许您需要将其添加到图表的选项中,

'tooltip' : {
  trigger: 'none'
}

这样您就可以将enableInteractivity 设置为true。

Maybe you need to add this to your chart's options

'tooltip' : {
  trigger: 'none'
}

In this way you can leave enableInteractivity set to true.

烟沫凡尘 2024-12-24 06:57:01

使用 enableInteractivity = False 选项。它将禁用交互和悬停。

chart.draw(data, {   
  width: 400, 
  height: 240, 
  title: 'Your chart and data',
  enableInteractivity: false,
  hAxis: {title: 'Year'}
});

Use the enableInteractivity = False option. It will disable interaction and hover.

chart.draw(data, {   
  width: 400, 
  height: 240, 
  title: 'Your chart and data',
  enableInteractivity: false,
  hAxis: {title: 'Year'}
});
思念绕指尖 2024-12-24 06:57:01

在选项部分设置工具提示:{ isHtml: true }。

chart.draw(data, {   
  tooltip: { isHtml: true },
  width: 400, 
  height: 240, 
  title: 'Title',
  hAxis: {title: 'Year'}
});

在CSS文件中

div.google-visualization-tooltip { display:none }

set tooltip: { isHtml: true } in option section.

chart.draw(data, {   
  tooltip: { isHtml: true },
  width: 400, 
  height: 240, 
  title: 'Title',
  hAxis: {title: 'Year'}
});

in css file

div.google-visualization-tooltip { display:none }
沫离伤花 2024-12-24 06:57:01

这会删除悬停事件,但保留单击事件:

tooltip: { trigger: 'selection' }

This remove hover event but maintains the click event:

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