Chartjs-Wrap Long Labels in the X-Axis Scales

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"); }),

Leave a comment