3๐
โ
You can use value.toLocaleString() which puts comma between thousands and then replaceAll to replace all commas with space.
plugins: {
datalabels: {
anchor: 'end',
align: 'right',
color: '#EA7B30',
formatter: function(value, context) {
return value.toLocaleString().replaceAll(',',' ')
},
}
}
Source:stackexchange.com