-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudentsAppCountChart.php
49 lines (36 loc) · 1.23 KB
/
StudentsAppCountChart.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace App\Http\Livewire;
use App\Insights\StudentApplications\StudentDataInsight;
use Livewire\Component;
class StudentsAppCountChart extends Component
{
public array $labels;
public array $data;
public $selected_semesters = [];
public $selected_schools = [];
protected $listeners = ['refreshData2', 'refreshChart2'];
public function mount()
{
$data = $this->dataset;
$this->data = $data['datasets'];
$this->labels = $data['labels'];
}
public function refreshChart2($data, $labels) {}
public function refreshData2($selected_semesters, $selected_schools) {
$this->selected_semesters = $selected_semesters;
$this->selected_schools = $selected_schools;
$data = $this->dataset;
$this->data = $data['datasets'];
$this->labels = $data['labels'];
$this->emit('refreshChart2', $this->data, $this->labels);
}
public function getDatasetProperty()
{
$report = new StudentDataInsight();
return $report->appsCountBySemestersAndSchools($this->selected_semesters, $this->selected_schools);
}
public function render()
{
return view('livewire.charts.students-app-count-chart');
}
}