如何使用鼠标Angular 6添加垂直线移动
canvas.onmousemove = function (evt) {
var points = myChart.getElementsAtXAxis(evt);
annotation.annotations[0].value = new Date(myChart.config.data.labels[points[0]._index]);
myChart.update();
在角度版本上不起作用,如何动态更改注释值
答案 0 :(得分: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();
};