0👍
The issue is with how you are formatting the labels in the chart configuration.
.map()
function splits the labels by space and return them as an array of strings chart is not able to interpret them correctly as labels.
You need to concatenate split labels into a single string with newline characters (\n)
between them.
labels: _label.map(x => { return x.split(" ").join("\n"); }),
- Chartjs-Two chart for the same set of data – Chart.js
- Chartjs-Updating chart.js based on selections from dropdown
Source:stackexchange.com