Remove hover tooltip from Google Visualization pie

2019-04-18 06:25发布

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.

4条回答
淡お忘
2楼-- · 2019-04-18 06:53

This remove hover event but maintains the click event:

tooltip: { trigger: 'selection' }
查看更多
戒情不戒烟
3楼-- · 2019-04-18 06:55

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

'tooltip' : {
  trigger: 'none'
}

In this way you can leave enableInteractivity set to true.

查看更多
Animai°情兽
4楼-- · 2019-04-18 06:55

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 }
查看更多
迷人小祖宗
5楼-- · 2019-04-18 07:00

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'}
});
查看更多
登录 后发表回答