<canvas id="weeklyChart"></canvas>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
    const ctx = document.getElementById('weeklyChart').getContext('2d');
    new Chart(ctx, {
        type: 'bar',
        data: {
            labels: {!! json_encode(array_keys($data)) !!},
            datasets: [{
                label: 'Total Penjualan (Rp)',
                data: {!! json_encode(array_values($data)) !!},
                backgroundColor: '#3b82f6'
            }]
        },
    });
</script>
