From 759eb5aea214d014ac7ac7be21396830da9ee552 Mon Sep 17 00:00:00 2001 From: cihan emre kisakurek Date: Fri, 25 Oct 2024 13:18:13 +0300 Subject: [PATCH] update chart fix --- resources/views/livewire/compositechart.blade.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/compositechart.blade.php b/resources/views/livewire/compositechart.blade.php index 5b522ce..20411c4 100644 --- a/resources/views/livewire/compositechart.blade.php +++ b/resources/views/livewire/compositechart.blade.php @@ -43,7 +43,11 @@ bar_chart = new Chart(ctx, bar_chart_config); var chart_data = JSON.parse(event.detail.chart_data); // chart.data.labels = chart_data.labels; - bar_chart.data.datasets[0].data = chart_data.data; + chart_data.dataset.forEach(function (value, i) { + // console.log('%d: %s', i, value); + bar_chart.data.datasets[i].data = value; + }); + // chart.update(); bar_chart.update('none'); });