Chartjs突出显示了多个点

时间:2015-01-23 03:15:14

标签: javascript graph chart.js

我正在使用Chartjs,而且它没有正确突出显示。它只应该一次突出显示一个数据点,但由于某种原因,它会突出显示鼠标右侧的所有数据点。我附上了一个gif来证明:

enter image description here

我的数据结构如下:

{
    "labels": ["", "", "", "", "", "", "", "", "", ""],
    "datasets": [{
        "data": [null, null, "5.00", null, null, null, "5.00", null, "2.00", null, "7.00", null, null, null],
        "label": "item 1",
        "fillColor": "rgba(0, 0, 0, 0.2)",
        "strokeColor": "rgb(255, 153, 0)",
        "pointColor": "rgba(198,229,217",
        "pointStrokeColor": "#fff",
        "pointHighlightFill": "#fff",
        "pointHighlightStroke": "rgba(220,220,220,1)"
    }, {
        "data": [null, null, null, null, null, null, null, null, null, null, "7.00", null, null, null],
        "label": "Item 2",
        "fillColor": "rgba(0, 255, 255, 0.46)",
        "strokeColor": "rgb(0, 255, 0)",
        "pointColor": "rgba(220,220,220,1)",
        "pointStrokeColor": "#fff",
        "pointHighlightFill": "#fff",
        "pointHighlightStroke": "rgba(220,220,220,1)"
    }, {
        "data": [null, null, null, null, null, null, null, null, null, null, null, null, null, null],
        "label": "Item 3",
        "fillColor": "rgba(198,229,217,.2)",
        "strokeColor": "rgba(198,229,217,1)",
        "pointColor": "rgba(220,220,220,1)",
        "pointStrokeColor": "#fff",
        "pointHighlightFill": "#fff",
        "pointHighlightStroke": "rgba(220,220,220,1)"
    }]
}

如果你能看到什么是错的,那就太好了。它是一个非常复杂的应用程序我正在构建,所以我可能在其他地方犯了错误。

0 个答案:

没有答案