I have a list of numbers in my pageController.php
$half2018 = [235, 1234, 134, 564, 364, 362];
return view('page', 'half2018'=>$half2018);
I call that variable in my page.blade.php
<canvas id="chart_1" class="chart-canvas" data-info="{{ $half2018 }}"></canvas>
Then at the end of page.blade.php I have
<script src="./assets/js/chart.js"></script>
In my chart.js file I call
let app = document.getElementById('claims_chart_12');
let info = JSON.parse(app.dataset.id);
console.log(info);
For some reason, JSON library is not loaded. Is it a right way to pass the data to .js file?