标签: chartjs-plugin-annotation

ChartsJS Annotations Plugin - 您可以创建一个工具提示来伴随注释吗?

我试图弄清楚当我将鼠标悬停/鼠标悬停在我绘制的垂直线注释上时如何添加工具提示:

annotation: {
   annotations: [{
      "drawTime": "afterDatasetsDraw",
      "type": "line",
      "mode": "vertical",
      "scaleID": "x-axis-0",
      "value": "2020-04-01 12:20:27.709523",
      "borderWidth": 2,
      "borderColor": "red",
      "label": {
        "content": "Example Content",
        "enabled": true,
        "position": "top"
      },
      onMouseover: function(e) {
        console.log("I AM GETTING CALLED!");
      },
   },
Run Code Online (Sandbox Code Playgroud)

有人能解释一下这是如何做到的吗?

javascript charts tooltip chart.js chartjs-plugin-annotation

5
推荐指数
1
解决办法
1805
查看次数