如何在高图中隐藏工具提示 [英] How can I hide tooltip in highcharts
本文介绍了如何在高图中隐藏工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望在移动光标时隐藏工具提示,但该列保持选中状态
I want a tooltip to hide when the cursor is moved, but the column remains selected
$(function () {
Highcharts.Pointer.prototype.reset = function () {
};
let chart = Highcharts.chart('bar', {
tooltip: {
shared: true,
hideDelay:100,
useHTML: true,
outside: true,
style: {
fontSize: "13px",
color: '#505050'
}
},
});
});
https://jsfiddle.net/alexserden/wq6j0tnp/6/ >
推荐答案
我准备了一个带有自定义功能的演示,当鼠标离开图表容器时该演示会隐藏工具提示.
I prepare a demo with custom function which hides tooltip when mouse leaves the chart container.
events: {
load() {
let chart = this;
chart.container.onmouseleave = function() {
chart.series[0].points.forEach(p => {
if(p.state === 'hover') {
chart.tooltip.hide(p)
}
})
}
}
}
演示: https://jsfiddle.net/BlackLabel/0ag7ojmy/
API: https://api.highcharts.com/highcharts/chart.events .load
这篇关于如何在高图中隐藏工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文