score:12

i was using chart.js and had the same exception when hovering over a point. when i put my data in double array, the chart did not show anything.

solution: if the chart is of type 'line', it does not take an array of colors for background and border, but single colors. this worked for me:

var chart = new chart(chartcanvas, {
    type : 'line',
    data : {
        labels : dates,
        datasets : [{
                label : 'error',
                data : errorcounts,
                backgroundcolor : 'rgba(255, 99, 132, 0.2)',
                bordercolor : 'rgba(255,99,132,1)',
                borderwidth : 1
            }, {
                label : 'ok',
                data : okcounts,
                backgroundcolor : 'rgba(75, 202, 72, 0.2)',
                bordercolor : 'rgba(117,239,95,1)',
                borderwidth : 1
            }
        ]
    },
    options : {
        responsive : true,
        scales : {
            yaxes : [{
                    ticks : {
                        beginatzero : true
                    }
                }
            ]
        }
    }
});

score:42

please make sure that your data is on double array.

ex:

data = [
  [10, 20, 30, 20, 10]
];

Related Query