Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show/hide google chart's tooltip programatically?

Is there any way to show/hide (open/close) google chart tooltip programatically? My tooltip is html enabled, trigger by 'selection'. I am trying to add a close icon to the tooltip.

like image 452
vCube Avatar asked Mar 24 '14 05:03

vCube


1 Answers

You can show it using setSelection() method, for example:

var options = {
    ....
    tooltip: { trigger: 'selection' }
    ...
}

chart.setSelection([{row:0, column:1}]);

See example at jsbin.

And hide it using empty object:

chart.setSelection([{}]);

See example at jsbin.

like image 191
Anto Jurković Avatar answered Oct 19 '22 12:10

Anto Jurković