首页 > 解决方案 > Why the chart js annotation is not working properly?

问题描述

enter image description here

chart js annotation is not working this is my codes this is the output enter image description here

标签: javascriptmodel-view-controller

解决方案


试试这个:(来自:https ://github.com/chartjs/chartjs-plugin-annotation )

{
    plugins: {
        annotation: {
            annotations: [{
                id: 'a-line-1',
                type: 'line',
                mode: 'horizontal',
                scaleID: 'y-axis-0',
                value: '25',
                borderColor: 'red',
                borderWidth: 2,
            }]
        }
    }
}

或检查此工作,例如:

https://jsfiddle.net/caj89x6L/


推荐阅读