Chartjs-How to solve Uncaught ReferenceError in console?

0👍

Have a look at the docs for chart.js.

It looks like you are not passing a valid node, jQuery instance, 2d context, or string id of the canvas of where you want to draw the chart to new Chart().

const ctx = document.querySelector('#doughnutChart');
var myDoughnutChart = new Chart(ctx, {
   type: 'doughnut',
   data: {...}
};

Alternatively, you can look at the source code.

Leave a comment