1

我正在使用 chart.js 2.6 和 chart.js-plugin-annotations 0.5.5 创建图表。

data["22:00","00:00","02:00","04:00","06:00","08:00","10:00","12:00","14:00","16:00","18:00","20:00","22:00","00:00","02:00"]

我想对每次出现的“00:00”进行注释以显示一天的结束。我试图有 2 个注释,但两者似乎都与“00:00”的第一次出现一致。

annotation: {
    annotations: [
        {
            type                : "line",
            mode                : "vertical",
            scaleID             : "x-axis-0",
            value               : "00:00",
            borderColor         : "rgba(255, 255, 255, 0.2)",               
        },
        {
            type                : "line",
            mode                : "vertical",
            scaleID             : "x-axis-0",
            value               : "00:00",
            borderColor         : "rgba(255, 255, 255, 0.2)",               
        }
    ]
}

任何想法如何做到这一点?

4

0 回答 0