I am facing an issue with the vue-chartJs
library. When I move the cursor fast, the vertical line on hover does not show up. However, when I move the cursor slowly, it works perfectly. Can anyone offer assistance in solving this problem?
onHover: function () {
if (this.chart.tooltip._active && this.chart.tooltip._active.length) {
var activePoint = this.chart.tooltip._active[0],
ctx = this.chart.ctx,
x = activePoint.tooltipPosition().x,
topY = this.chart.scales["y-axis-0"].top,
bottomY = this.chart.scales["y-axis-0"].bottom;
ctx.save();
ctx.beginPath();
ctx.moveTo(x, topY);
ctx.lineTo(x, bottomY);
ctx.lineWidth = 1;
ctx.setLineDash([3, 3]);
ctx.strokeStyle = "#45171d";
ctx.stroke();
ctx.restore();
}
}