Chartjs-Chart.js – annotation Vertical line moves with mouse in Angular 6

0👍

canvas.onmousemove = (evt) => {

        docCountChart.update();

        var x = evt.pageX - canvas.offsetLeft - 30;

        context.beginPath();

        context.moveTo(x, 32);
        context.lineTo(x, 407);
        context.strokeStyle = 'gray';
        context.stroke();
        context.closePath();
    };

Leave a comment