0đź‘Ť
From the chartjs-plugin-datalabels documentation, you need to register the plugin globally or locally].
Register globally:
import ChartDataLabels from 'chartjs-plugin-datalabels';
Chart.register(ChartDataLabels);
Or register locally:
import ChartDataLabels from 'chartjs-plugin-datalabels';
const config: ChartConfiguration = {
type: 'doughnut',
data: {
datasets: data,
labels: ['Red', 'Orange', 'Yellow', 'Green', 'Blue'],
},
options: options,
plugins: [ChartDataLabels] // Register locally
};
- Chartjs-Chart.js not drawing with AngularJS
- Chartjs-How to update JS variable in value field of charts.js?
Source:stackexchange.com