0👍
The problem is that Chart.js
is not aware of what chartjs-plugin-datalabels
is doing. Therefore, it doesn’t reserve enough space at the right of the chart, allowing the labels of the largest bars to appear on the canvas
.
This can be fixed by defining extra padding at the right of the chart as follows.
options: {
layout: {
padding: {
right: 100
}
},
...
For further details, please consult the page Layout Configuration from the
Chart.js
documentation.
- Chartjs-Displaying dataset labels in Chart.js line graph
- Chartjs-Hide data labels chart.js and draw/mark y = 0 with thicker line
Source:stackexchange.com