问题
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/
回答1:
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)
}
})
}
}
}
Demo: https://jsfiddle.net/BlackLabel/0ag7ojmy/
API: https://api.highcharts.com/highcharts/chart.events.load
来源:https://stackoverflow.com/questions/60632236/how-can-i-hide-tooltip-in-highcharts