diff --git a/src/LarapexChart.php b/src/LarapexChart.php index 699a185..8d13834 100644 --- a/src/LarapexChart.php +++ b/src/LarapexChart.php @@ -35,7 +35,7 @@ class LarapexChart protected $toolbar; protected $zoom; protected $dataLabels; - protected $sparklines; + protected $sparkline; private $chartLetters = 'abcdefghijklmnopqrstuvwxyz'; /* @@ -55,7 +55,7 @@ public function __construct() $this->toolbar = json_encode(['show' => false]); $this->zoom = json_encode(['enabled' => true]); $this->dataLabels = json_encode(['enabled' => false]); - $this->sparklines = json_encode(['enabled' => false]); + $this->sparkline = json_encode(['enabled' => false]); $this->fontFamily = config('larapex-charts.font_family'); $this->foreColor = config('larapex-charts.font_color'); return $this; @@ -255,9 +255,9 @@ public function setDataLabels(bool $enabled = true) :LarapexChart return $this; } - public function setSparklines(bool $enabled = true): LarapexChart + public function setSparkline(bool $enabled = true): LarapexChart { - $this->sparklines = json_encode(['enabled' => $enabled]); + $this->sparkline = json_encode(['enabled' => $enabled]); return $this; } @@ -460,9 +460,9 @@ public function dataLabels() /** * @return true|boolean */ - public function sparklines() + public function sparkline() { - return $this->sparklines; + return $this->sparkline; } /* @@ -482,7 +482,7 @@ public function toJson() 'zoom' => json_decode($this->zoom()), 'fontFamily' => json_decode($this->fontFamily()), 'foreColor' => $this->foreColor(), - 'sparklines' => $this->sparklines(), + 'sparkline' => $this->sparkline(), ], 'plotOptions' => [ 'bar' => json_decode($this->horizontal()), @@ -527,7 +527,7 @@ public function toVue() :array 'zoom' => json_decode($this->zoom()), 'fontFamily' => json_decode($this->fontFamily()), 'foreColor' => $this->foreColor(), - 'sparkline' => json_decode($this->sparklines()), + 'sparkline' => json_decode($this->sparkline()), ], 'plotOptions' => [ 'bar' => json_decode($this->horizontal()), diff --git a/stubs/resources/views/chart/script.blade.php b/stubs/resources/views/chart/script.blade.php index 51b9884..1272423 100644 --- a/stubs/resources/views/chart/script.blade.php +++ b/stubs/resources/views/chart/script.blade.php @@ -9,7 +9,7 @@ zoom: {!! $chart->zoom() !!}, fontFamily: '{!! $chart->fontFamily() !!}', foreColor: '{!! $chart->foreColor() !!}', - sparkline: {!! $chart->sparklines() !!} + sparkline: {!! $chart->sparkline() !!} }, plotOptions: { bar: {!! $chart->horizontal() !!}