-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAcceptedStudentAppsPercentageChart.php
55 lines (41 loc) · 1.52 KB
/
AcceptedStudentAppsPercentageChart.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
50
51
52
53
54
55
<?php
namespace App\Http\Livewire;
use App\Helpers\Semester;
use App\Insights\StudentApplications\StudentDataInsight;
use Livewire\Component;
class AcceptedStudentAppsPercentageChart extends Component
{
public array $labels;
public array $data;
public array $selected_semesters;
public array $selected_schools;
public $selected_filing_statuses;
protected $listeners = ['refreshData3', 'refreshChart3'];
public function mount($selected_semesters, $selected_schools)
{
$this->selected_semesters = [Semester::current()];
//$this->selected_schools = $selected_schools;
// $this->selected_filing_statuses = ["accepted"];
}
public function refreshChart3($data, $labels) {}
public function refreshData3($selected_semesters, $selected_schools) {
$this->selected_semesters = $selected_semesters;
$this->selected_schools = $selected_schools;
$data = $this->getData();
$this->data = $data['datasets'];
$this->labels = $data['labels'];
$this->emit('refreshChart3', $this->data, $this->labels);
}
public function getData()
{
$report = new StudentDataInsight();
return $report->transformDataAcceptedInCurrentSeason($this->selected_semesters, $this->selected_schools);
}
public function render()
{
$data = $this->getData();
$this->data = $data['datasets'];
$this->labels = $data['labels'];
return view('livewire.accepted-student-apps-percentage-chart');
}
}