Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/LarapexChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class LarapexChart
protected string $markers;
protected bool $stacked = false;
protected bool $showLegend = true;
protected bool $showXAxisLabels = true;
protected string $stroke = '';
protected string $toolbar;
protected string $zoom;
Expand Down Expand Up @@ -285,6 +286,12 @@ public function setShowLegend(bool $showLegend = true): self
return $this;
}

public function setShowXAxisLabels(bool $showXAxisLabels = true): self
{
$this->showXAxisLabels = $showXAxisLabels;
return $this;
}

/*
|--------------------------------------------------------------------------
| Getters
Expand Down Expand Up @@ -429,6 +436,11 @@ public function showLegend(): string
return $this->showLegend ? 'true' : 'false';
}

public function showXAxisLabels(): bool
{
return $this->showXAxisLabels;
}

/*
|--------------------------------------------------------------------------
| JSON Options Builder
Expand Down Expand Up @@ -467,6 +479,9 @@ public function toJson(): \Illuminate\Http\JsonResponse
],
'xaxis' => [
'categories' => json_decode($this->xAxis()),
'labels' => [
'show' => $this->showXAxisLabels(),
]
],
'grid' => json_decode($this->grid()),
'markers' => json_decode($this->markers()),
Expand Down Expand Up @@ -524,6 +539,9 @@ public function toVue() :array
],
'xaxis' => [
'categories' => json_decode($this->xAxis()),
'labels' => [
'show' => $this->showXAxisLabels(),
]
],
'grid' => json_decode($this->grid()),
'markers' => json_decode($this->markers()),
Expand Down
5 changes: 4 additions & 1 deletion stubs/resources/views/chart/script.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
align: '{!! $chart->subtitlePosition() !!}'
},
xaxis: {
categories: {!! $chart->xAxis() !!}
categories: {!! $chart->xAxis() !!},
labels : {
show: {!! $chart->showXAxisLabels() !!}
}
},
grid: {!! $chart->grid() !!},
markers: {!! $chart->markers() !!},
Expand Down