'1M', 'name' => '1 month'], ['id' => '3M', 'name' => '3 months'], ['id' => 'YTD', 'name' => 'Year to date'], ['id' => '1Y', 'name' => '1 year'], ['id' => '3Y', 'name' => '3 years'], ['id' => 'ALL', 'name' => 'All time'] ]; // data public Array $myChart; // methods public function mount() { $this->myChart = [ 'series' => [ [ 'name' => __('Total Views'), 'data' => $this->generateDateSeries('2024-01-01', '2024-08-01') ], [ 'name' => __('Second Views'), 'data' => $this->generateDateSeries('2024-01-01', '2024-08-01') ], ], ]; } public function changeScope($scope) { $this->scope = $scope; $this->dispatch('data-scope-updated', $scope); } public function getScopeName($scope) { return collect($this->options)->where('id', $scope)['name']; } private function generateDateSeries($startDate, $endDate) { $dateArray = []; $currentDate = strtotime($startDate); $endDate = strtotime($endDate); while ($currentDate <= $endDate) { // Generate a random integer $randomInt = rand(1000, 3000); // Format the current date to 'Y-m-d' $formattedDate = date('Y-m-d', $currentDate); // Append the date and random integer to the array $dateArray[] = [$formattedDate, $randomInt]; // Move to the next day $currentDate = strtotime("+1 day", $currentDate); } return $dateArray; } }; ?>

{{ __('Performance') }}

@foreach($options as $option) @endforeach