且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何以编程方式显示/隐藏Google图表的工具提示?

更新时间:2023-11-14 18:12:52

您可以使用setSelection()方法显示它,例如:

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

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

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

请参见 jsbin上的示例.

并使用空对象将其隐藏:

And hide it using empty object:

chart.setSelection([{}]);

请参见 jsbin中的示例.