{{-- start chart --}} const {{$id}} = document.getElementById("{{$id}}"); var salesChart2 = new Chart({{$id}}, { type : 'bar', data : { labels : labelmonth, datasets: [ { backgroundColor: primarycolor, borderColor : primarycolor, data : [ @forelse ($c_primary as $count) {{ $count }}{{ ',' }} @empty @endforelse ] }, { backgroundColor: '#ced4da', borderColor : '#ced4da', data : [ @if($counts2) @forelse ($counts2 as $count) {{ $count }}{{ ',' }} @empty @endforelse @endif ] } ] }, options: coptions }) {{-- end chart --}}