fix: 🐛 error on chart.js
This commit is contained in:
parent
4a03763703
commit
236cd4b062
3 changed files with 6 additions and 84 deletions
83
public/assets/js/Chart.js
vendored
83
public/assets/js/Chart.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,7 @@
|
|||
import "../../sass/front/app.scss";
|
||||
import Chart from 'chart.js/auto';
|
||||
|
||||
// COOKIES
|
||||
import CookieNotice from "@ldc-web/cookie-notice";
|
||||
window.CookieNotice = CookieNotice;
|
||||
window.Chart = Chart;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@
|
|||
@endphp
|
||||
<canvas id="{{ $id }}" width="400" height="400"></canvas>
|
||||
<script nonce="{{ $nonce ?? '' }}">
|
||||
new Chart(document.getElementById('{{ $id }}'), {!! json_encode($chart) !!});
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
new window.Chart(document.getElementById('{{ $id }}'), {!! json_encode($chart) !!});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@if($g['type'] === 'list_bilan_simplify')
|
||||
|
|
@ -61,3 +63,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue