Skip to content

Commit

Permalink
Fixed options some option function method issue solved.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 24, 2022
1 parent 85701ef commit e216878
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 46 deletions.
5 changes: 3 additions & 2 deletions src/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Akaunting\Apexcharts\Support\DatasetClass;
use Akaunting\Apexcharts\Traits\Formatter;
use Akaunting\Apexcharts\Traits\Types;
use Balping\JsonRaw\Encoder;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\View as ViewFacade;
use Illuminate\View\View;
Expand Down Expand Up @@ -182,9 +183,9 @@ public function setOptions(array|Collection $options = [], bool $overwrite = fal
return $this;
}

public function getOptions(): array
public function getOptions(): string
{
return $this->options;
return Encoder::encode($this->options);
}

public function container(string $container = null): Chart|View
Expand Down
43 changes: 0 additions & 43 deletions src/Views/script.blade copy.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Views/script.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script type="text/javascript"><!--
var options = {!! json_encode($chart->getOptions()) !!};
var options = {!! $chart->getOptions() !!};
var chart_{{ $chart->getId() }} = new ApexCharts(document.querySelector("#{!! $chart->getId() !!}"), options);
Expand Down

0 comments on commit e216878

Please sign in to comment.