vCube
vCube

Reputation: 181

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.

Upvotes: 7

Views: 6202

Answers (1)

Anto Jurković
Anto Jurković

Reputation: 11258

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.

Upvotes: 12

Related Questions