2024-06-17 12:21:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\View\Components;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
use Illuminate\View\Component;
|
|
|
|
|
|
|
|
class ApexCharts extends Component
|
|
|
|
{
|
|
|
|
public string $chartId;
|
2024-06-17 12:22:17 +00:00
|
|
|
|
2024-06-17 12:21:27 +00:00
|
|
|
public $seriesData;
|
2024-06-17 12:22:17 +00:00
|
|
|
|
2024-06-17 12:21:27 +00:00
|
|
|
public $categories;
|
2024-06-17 12:22:17 +00:00
|
|
|
|
2024-06-17 12:21:27 +00:00
|
|
|
public $seriesName;
|
2024-06-17 12:22:17 +00:00
|
|
|
|
2024-06-17 12:21:27 +00:00
|
|
|
public function __construct($chartId, $seriesData, $categories, $seriesName = '')
|
|
|
|
{
|
|
|
|
$this->chartId = $chartId;
|
|
|
|
$this->seriesData = $seriesData;
|
|
|
|
$this->categories = $categories;
|
|
|
|
$this->seriesName = $seriesName ?? 'Series';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the view / contents that represent the component.
|
|
|
|
*/
|
|
|
|
public function render(): View|Closure|string
|
|
|
|
{
|
|
|
|
return view('components.apex-charts');
|
|
|
|
}
|
|
|
|
}
|