You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.8 KiB
65 lines
1.8 KiB
<?php
|
|
|
|
use App\Domains\Identity\Queries\Dashboard\GetUserGrowthTrends;
|
|
use Livewire\Attributes\Computed;
|
|
use Livewire\Component;
|
|
|
|
new class extends Component
|
|
{
|
|
public function mount(): void
|
|
{
|
|
$this->dispatch('chart-user-growth-update',
|
|
series: [[
|
|
'name' => __('domains/identity/dashboard.user_growth.series_name'),
|
|
'data' => $this->userGrowth['series'],
|
|
]],
|
|
options: [
|
|
'xaxis' => [
|
|
'categories' => $this->userGrowth['categories'],
|
|
],
|
|
]
|
|
);
|
|
}
|
|
|
|
#[Computed]
|
|
public function userGrowth(): array
|
|
{
|
|
return app(GetUserGrowthTrends::class)->fetch();
|
|
}
|
|
};
|
|
?>
|
|
<div class="card bg-opacity-10 border-opacity-25 rounded-2 border">
|
|
<div class="card-body">
|
|
<div class="d-flex gap-3">
|
|
<div class="icon-shape icon-md bg-secondary rounded-2 text-white">
|
|
@svg('tabler-user-pin', [
|
|
'class' => 'fs-4',
|
|
])
|
|
</div>
|
|
<div>
|
|
<h2 class="fs-4">{{ __('domains/identity/dashboard.user_growth.title') }}</h2>
|
|
<p class="text-secondary small mb-0">
|
|
{{ __('domains/identity/dashboard.user_growth.subtitle', ['year' => now()->year]) }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div
|
|
id="user-growth"
|
|
x-chart="{
|
|
chart: {
|
|
type: 'line',
|
|
height: 360,
|
|
toolbar: {show: false}
|
|
},
|
|
series: [],
|
|
colors: ['#4f46e5']
|
|
}"
|
|
></div>
|
|
</div>
|
|
</div>
|
|
|
|
@once
|
|
@push('page-scripts')
|
|
@vite('resources/js/plugin/apexchart.js')
|
|
@endpush
|
|
@endonce
|
|
|