Skip to content

Commit e216878

Browse files
committed
Fixed options some option function method issue solved.
1 parent 85701ef commit e216878

File tree

3 files changed

+4
-46
lines changed

3 files changed

+4
-46
lines changed

src/Chart.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Akaunting\Apexcharts\Support\DatasetClass;
2525
use Akaunting\Apexcharts\Traits\Formatter;
2626
use Akaunting\Apexcharts\Traits\Types;
27+
use Balping\JsonRaw\Encoder;
2728
use Illuminate\Support\Collection;
2829
use Illuminate\Support\Facades\View as ViewFacade;
2930
use Illuminate\View\View;
@@ -182,9 +183,9 @@ public function setOptions(array|Collection $options = [], bool $overwrite = fal
182183
return $this;
183184
}
184185

185-
public function getOptions(): array
186+
public function getOptions(): string
186187
{
187-
return $this->options;
188+
return Encoder::encode($this->options);
188189
}
189190

190191
public function container(string $container = null): Chart|View

src/Views/script.blade copy.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/Views/script.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script type="text/javascript"><!--
2-
var options = {!! json_encode($chart->getOptions()) !!};
2+
var options = {!! $chart->getOptions() !!};
33
44
var chart_{{ $chart->getId() }} = new ApexCharts(document.querySelector("#{!! $chart->getId() !!}"), options);
55

0 commit comments

Comments
 (0)