{{-- Universal reusable chart component. Uses Chart.js and the global createChart(canvasId, config). Config shape (Chart.js): - type: 'line' | 'bar' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | ... - data: { labels: string[], datasets: Array<{ label?, data, backgroundColor?, borderColor?, ... }> } - options: (optional) Chart.js options: title, subtitle, legend, scales (xAxes, yAxes), tooltips, etc. Usage: Client-side: createChart('myChart', { type: 'bar', data: {...}, options: {...} }); --}} @props([ 'id', 'config' => [], ]) @php $config = is_array($config) ? $config : []; @endphp
merge(['class' => 'chart-wrapper'])->except(['id', 'config']) }}>
@push('scripts') @endpush