diff --git a/src/Builder.php b/src/Builder.php index 2569e2a..0783fba 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -168,10 +168,7 @@ public function render() $inLivewire = $chart['inLivewire'] ?? (class_exists('Livewire\\Livewire') ? \Livewire\Livewire::isLivewireRequest() : false); $view = ($inLivewire ? 'laravelchartjs::chart-template-livewire' : 'laravelchartjs::chart-template'); - $optionsRaw = $chart['optionsRaw'] ?? null; - $optionsSimple = $chart['options'] ? $chart['options'] : null; - $options = $optionsRaw ? $optionsRaw : $optionsSimple; - $options = (is_string($options) ? json_decode($options) : $options); + $options = $chart['optionsRaw'] ?? json_encode($chart['options']); return view($view)->with([ 'datasets' => json_encode($chart['datasets']), diff --git a/src/resources/views/chart-template-livewire.blade.php b/src/resources/views/chart-template-livewire.blade.php index fe6b8f0..c509581 100644 --- a/src/resources/views/chart-template-livewire.blade.php +++ b/src/resources/views/chart-template-livewire.blade.php @@ -1,6 +1,6 @@