15👍
As with most CSS, the answer is to use another wrapper!
I had the same problem (and I’m using box sizing)
Just put one div around your canvas! (the divs will inherit the box sizing)
<div>
<canvas></canvas>
</div>
Good luck
🙂
9👍
This will solve the issue
Javascript:
new Chart(ctx).Line(data, {
responsive:true,
maintainAspectRatio: false
});
ES6
Chart.defaults.global.responsive = true;
Chart.defaults.global.maintainAspectRatio = false;
- [Chartjs]-How can I sort data from highest to lowest in chart.js
- [Chartjs]-ReferenceError: Chart is not defined – chartjs
Source:stackexchange.com