Bugs :

Test / Demo : https://codepen.io/anon/pen/VWbBor
Issue#A
Issue#B
Config on options is :
options: {
tooltips: {
enabled: true,
mode: 'index',
intersect: false
}
}
Having tested this I've discovered that the problem for the jittery animation is when the tooltip settings are:
mode: 'index',
intersect: false
What happens is that when the mouse moves over the index, the tooltip begins to move. However, the moment the mouse hits the bar (if the tooltip is still moving), the tooltip restarts its animation from the beginning.
It looks like intersect: false probably isn't being read properly (or at all) wherever the tooltip animation is triggered.
It also looks like the "current index" of the tooltip position doesn't actually get changed until _after_ the animation is complete, which, in my opinion, is not the correct order to do things in. In fact, this is probably the change that caused the problem and revealed that intersect: false doesn't get checked in index mode.
NOTE: This also happens on line graphs. If you arrive at the index, the tooltip will move, then if you hit the circle for that data point while it's moving, the tooltip will restart its movement just as it does in the bar graph.
ALSO NOTE: This issue was introduced by 2.6.0 and isn't found in 2.5.0.
Thanks for the investigation @danegraphics. Not sure what changed in 2.6 but it sounds like the fix is only to retrigger the animation if the index changes in index mode.
Is there an update for clearing/hiding tooltips after touchEnd?
@l2aelba Adding the event "touchend" to the options like this, removes the tooltip after touchend.
events: ["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]
This was changed here: https://github.com/chartjs/Chart.js/pull/1644/files
Has anyone found a workaround for this? I've just ran into this issue.
Okay, in my case adding the following fixed it,
options: {
hover: {
intersect: false
}
}
Here is the updated example for issue A mentioned here: https://codepen.io/anon/pen/aVPewe
Still did not work always for me.
I started to remove the tooltip after one second.
this.chart = new Chart(this.canvas.nativeElement, {CONFIG});
// CONFIG:
{
type: 'line',
options: {
events: ['mousemove', 'mouseout', 'touchmove', 'touchend'],
animation: {
duration: 0
},
hover: {
animationDuration: 0, // duration of animations when hovering an item
intersect: false
},
tooltips: {
mode: 'index',
intersect: false,
enabled: true,
callbacks: {
label: (tooltipItem: ChartTooltipItem) => {
// ...
clearTimeout(this.updateToolTipTimeout);
this.updateToolTipTimeout = window.setTimeout(() => this.chart.update(), 1000);
// ...
}
}
}
}
}
I'm closing this as resolved, feel free to reopen if one of the issues still exist.
Most helpful comment
Having tested this I've discovered that the problem for the jittery animation is when the tooltip settings are:
What happens is that when the mouse moves over the index, the tooltip begins to move. However, the moment the mouse hits the bar (if the tooltip is still moving), the tooltip restarts its animation from the beginning.
It looks like intersect: false probably isn't being read properly (or at all) wherever the tooltip animation is triggered.
It also looks like the "current index" of the tooltip position doesn't actually get changed until _after_ the animation is complete, which, in my opinion, is not the correct order to do things in. In fact, this is probably the change that caused the problem and revealed that intersect: false doesn't get checked in index mode.
NOTE: This also happens on line graphs. If you arrive at the index, the tooltip will move, then if you hit the circle for that data point while it's moving, the tooltip will restart its movement just as it does in the bar graph.
ALSO NOTE: This issue was introduced by 2.6.0 and isn't found in 2.5.0.