2๐
โ
I was able to figure this out, instead of displaying the whole value, which in the current case was an object, I had to use formatter with a callback function fetching value of x, in the plugins option.
options: {
plugins: {
datalabels: {
formatter: ( val ) => {
return val.x
},
}
}
}
Source:stackexchange.com