如何以编程方式显示/隐藏Google图表的工具提示? [英] How to show/hide google chart's tooltip programatically?
本文介绍了如何以编程方式显示/隐藏Google图表的工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以以编程方式显示/隐藏(打开/关闭)Google图表工具提示吗?我的工具提示是启用了HTML ,是通过"选择"触发的.我正在尝试在工具提示中添加一个关闭图标.
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.
推荐答案
您可以使用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中的示例.
这篇关于如何以编程方式显示/隐藏Google图表的工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文