1👍
Looks like newer versions of ChartJS require you to register the individual elements you’re going to use.
You need to register the legend specifically.
import { Chart, Legend } from 'chart.js';
// ...
Chart.register(Legend);
- [Chartjs]-Chart line not appearing in a semi log chart using chart.js
- [Chartjs]-Charts.js data doesn't fit second y-axis
Source:stackexchange.com