简体   繁体   中英

Remove hover tooltip from Google Visualization pie chart (core chart)

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

在此输入图像描述

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.

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

'tooltip' : {
  trigger: 'none'
}

In this way you can leave enableInteractivity set to true.

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'}
});

这会删除悬停事件,但会维护click事件:

tooltip: { trigger: 'selection' }

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 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM