Chartjs-Chart js Backgroundimage Scaling

0👍

Have you tried using the maintainAspectRatio property and setting it to true? That should hopefully fix your window resize issue.

The only way to fix the legend issue is to use a legend that is external to the canvas because the legend takes up space in the canvas so the chart is squished horizontally (there is no layering concept in a canvas). See this example for how to generate an external legend.

You must use the legendCallback property and the .generateLegend() prototype method.

Leave a comment