Chart.js 2.2.1
Any idea how to trigger the code that runs when I hover over a datapoint, and that runs when I move the mouse off? I need to programmatically show and hide a chart's tooltip.
openTip(oChart, datasetIndex, pointIndex){
// how to open a specific tooltip?
}
closeTip(oChart, datasetIndex, pointIndex){
// how to close the same tooltip?
}
I would show sample code if I could, but I don't even know where to start. The chart method docs haven't helped.
The code below will handle one or more tooltips.
Complete solution provided by @BeetleJuice - https://jsfiddle.net/ucvvvnm4/5/
I would be careful accessing/modifying private variables that begin with
_
. You may find yourself with unexpected behavior. Why not trigger the canvasmousemove
eventTo close the tooltip just trigger the
mouseout
event