44π
I had the same thing. You have to put an empty div around the canvas.
5π
Iβve found some users had the same issue in this post: https://github.com/jtblin/angular-chart.js/issues/84
The solution for me was to change the chartβs options to maintainAspectRatio: false.
myChart.setOptions({
responsive: true,
maintainAspectRatio: false
});
- [Chartjs]-Change color of X and Y axis values in Chart.js
- [Chartjs]-How to modify bar width in Chartjs 2 bar charts
1π
In laravel livewire i fixed adding wire:ignore
to wrapper div
<div wire:ignore>
<div class="chart-container" style="height: 80vh; width: 80vh;">
<canvas id="bar-chart" height="800" width="1500"></canvas>
</div>
</div>
-2π
I was having the same issue in a Bulma tile.
The fix was to set
responsive: false
in the Chart.js script options area.
- [Chartjs]-Chartjs cannot read property datasets of undefined
- [Chartjs]-Chart.js core.js:6162 ERROR Error: "line" is not a registered controller
Source:stackexchange.com