0๐
โ
You can define a formatter
as shown below. The function returns an empty string if the value is zero, the value itself otherwise.
plugins:{
datalabels: {
align: 'end',
anchor: 'end',
formatter: v => v ? v : ''
}
}
For further details, please consult Custom Labels from the
chartjs-plugin-datalabels
documentation.
Source:stackexchange.com