Chartjs-Issue with legend boxes in ChartJS

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!

Leave a comment