0👍
It could be due to the fact that your canvas isn’t big enough to fit your legend at small enough sizes.
One solution would be to create a custom legend that is completely separate from the canvas. This can be done using the legendcallback function.
e.g
legendCallback: function (chartInstance) {
//Generate legend here
}
Also, make sure that you have
responsive: true
set in your chart options.
Hope this helps!
- Chartjs-Chart.js – Add corporate design to chart
- Chartjs-Automatic Y-axis scale: max is always as 120% of highest value in ChartJS
Source:stackexchange.com