ChartJS注释问题

时间:2017-05-10 13:18:46

标签: annotations chart.js

我试图在我的注释垂直线上使用float / double值来描绘钟形曲线的平均值。当我为chartjs使用提供的注释插件时,它不会让我使用带小数的浮动值。

    var opt1 = {
                canvasBorders: true,
                canvasBordersWidth: 3,
                canvasBordersColor: "black",
                legend: true,
                datasetFill: false,
                annotateDisplay: true,
                pointDot: false,
                animationLeftToRight: true,
                animationEasing: "linear",
                yAxisMinimumInterval: 0.02,
                graphTitleFontSize: 18,
                scales: {
                    yAxes: [{
                        position: "left",
                        "id": "y-axis-0"
                    }, {
                        position: "right",
                        "id": "y-axis-1"
                    }],
                    xAxes: [{
                        "id": "tots-1",
                    }]
                },
                annotation: {
                    annotations: [{
                        id: 'a-line-1', // optional
                        type: 'line',
                        mode: 'vertical',
                        scaleID: 'tots-1',
                        value: average,
                        borderColor: 'red',
                        borderWidth: 5,}]
                   }
                },
             }

有什么想法吗?

0 个答案:

没有答案