0👍
The syntax is different if you are using Chart.js v1 or v2.
And you said you imported the v2 library, but you are still using the v1 syntax with :
var chart = new Chart(ctx).Doughnut(data);
To fix this, you can change the syntax to the v2’s :
var myChart = new Chart(ctx, {
type: 'doughnut',
data: data
});
- Chartjs-Limit data in Chart.js with Flask/SQLAlchemy in python
- Chartjs-How to get 2 doughnut charts in one chart (chartjs)
Source:stackexchange.com