|
@@ -141,6 +141,10 @@ class ChartGenerator {
|
|
|
return $chart;
|
|
return $chart;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param array $venue_type_data
|
|
|
|
|
+ * @return Chart[]
|
|
|
|
|
+ */
|
|
|
public function getVenueTypeChallengeStagePieCharts(array $venue_type_data): array {
|
|
public function getVenueTypeChallengeStagePieCharts(array $venue_type_data): array {
|
|
|
$field = $this->template->getChallengeStageField();
|
|
$field = $this->template->getChallengeStageField();
|
|
|
if(!$field) {
|
|
if(!$field) {
|
|
@@ -219,7 +223,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
// Charts
|
|
// Charts
|
|
|
public function getTestsByStageChart(array $labels, string $title = "Tests by Stage"): Chart {
|
|
public function getTestsByStageChart(array $labels, string $title = "Tests by Stage"): Chart {
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("doughnut");
|
|
$chart->setType("doughnut");
|
|
|
$chart->setTitle("$title ({$this->dateRangeLabel})");
|
|
$chart->setTitle("$title ({$this->dateRangeLabel})");
|
|
|
$chart->setLabels($labels);
|
|
$chart->setLabels($labels);
|
|
@@ -248,7 +252,7 @@ class ChartGenerator {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function getChallengerGenderChart(): Chart {
|
|
public function getChallengerGenderChart(): Chart {
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle("Staff Gender ({$this->dateRangeLabel})");
|
|
$chart->setTitle("Staff Gender ({$this->dateRangeLabel})");
|
|
|
$chart->setLabels(["Male", "Female", "Unspecified"]);
|
|
$chart->setLabels(["Male", "Female", "Unspecified"]);
|
|
@@ -268,7 +272,7 @@ class ChartGenerator {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function getTesterGenderChart(): Chart {
|
|
public function getTesterGenderChart(): Chart {
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle("Tester Gender ({$this->dateRangeLabel})");
|
|
$chart->setTitle("Tester Gender ({$this->dateRangeLabel})");
|
|
|
$chart->setLabels(["Male", "Female"]);
|
|
$chart->setLabels(["Male", "Female"]);
|
|
@@ -298,7 +302,7 @@ class ChartGenerator {
|
|
|
$colours[] = self::COLOUR_GREY;
|
|
$colours[] = self::COLOUR_GREY;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle("{$title} ({$this->dateRangeLabel})");
|
|
$chart->setTitle("{$title} ({$this->dateRangeLabel})");
|
|
|
$chart->setLabels($labels);
|
|
$chart->setLabels($labels);
|
|
@@ -344,7 +348,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
public function getPeriodicPassFailRateChart(string $title = "Pass / Fail"): Chart {
|
|
public function getPeriodicPassFailRateChart(string $title = "Pass / Fail"): Chart {
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addXAxis([
|
|
$chart->addXAxis([
|
|
|
"type" => "category",
|
|
"type" => "category",
|
|
|
"stacked" => true,
|
|
"stacked" => true,
|
|
@@ -522,7 +526,7 @@ class ChartGenerator {
|
|
|
$pass_counts = $this->getPeriodicPassCounts();
|
|
$pass_counts = $this->getPeriodicPassCounts();
|
|
|
$fail_counts = $this->getPeriodicFailCounts();
|
|
$fail_counts = $this->getPeriodicFailCounts();
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
$chart->setTitle("{$title} by {$this->resolutionName}");
|
|
$chart->setTitle("{$title} by {$this->resolutionName}");
|
|
|
$chart->setLabels($this->xDataLabels);
|
|
$chart->setLabels($this->xDataLabels);
|
|
@@ -590,7 +594,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
if($period_data->testCount === 0) continue;
|
|
if($period_data->testCount === 0) continue;
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle(sprintf($title_format, $key_label));
|
|
$chart->setTitle(sprintf($title_format, $key_label));
|
|
|
$chart->setLabels($labels);
|
|
$chart->setLabels($labels);
|
|
@@ -623,7 +627,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
$counts = array_merge($male_counts, $female_counts);
|
|
$counts = array_merge($male_counts, $female_counts);
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addYAxis([
|
|
$chart->addYAxis([
|
|
|
"id" => "y-axis-1",
|
|
"id" => "y-axis-1",
|
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($counts) / 10) * 10]
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($counts) / 10) * 10]
|
|
@@ -646,7 +650,7 @@ class ChartGenerator {
|
|
|
$pass_rates = $this->getPeriodicPassRates();
|
|
$pass_rates = $this->getPeriodicPassRates();
|
|
|
$pass_rate_max = ceil(max($pass_rates) / 10) * 10;
|
|
$pass_rate_max = ceil(max($pass_rates) / 10) * 10;
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addYAxis([
|
|
$chart->addYAxis([
|
|
|
"id" => "y-axis-1",
|
|
"id" => "y-axis-1",
|
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($test_counts) / 10) * 10]
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($test_counts) / 10) * 10]
|
|
@@ -719,7 +723,7 @@ class ChartGenerator {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Gender Comparison by Date Range
|
|
// Gender Comparison by Date Range
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addYAxis([
|
|
$chart->addYAxis([
|
|
|
"id" => "y-axis-1",
|
|
"id" => "y-axis-1",
|
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($gender_test_counts) / 10) * 10]
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($gender_test_counts) / 10) * 10]
|
|
@@ -741,7 +745,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
$counts = array_merge($mcm_counts, $mcf_counts, $fcm_counts, $fcf_counts);
|
|
$counts = array_merge($mcm_counts, $mcf_counts, $fcm_counts, $fcf_counts);
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addYAxis([
|
|
$chart->addYAxis([
|
|
|
"id" => "y-axis-1",
|
|
"id" => "y-axis-1",
|
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($counts) / 10) * 10]
|
|
"tick_config" => ["min" => 0, "max" => ceil(max($counts) / 10) * 10]
|
|
@@ -791,7 +795,7 @@ class ChartGenerator {
|
|
|
${$prefix . "_pass_rates"} = $pass_rates;
|
|
${$prefix . "_pass_rates"} = $pass_rates;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addYAxis([
|
|
$chart->addYAxis([
|
|
|
"id" => "y-axis-1",
|
|
"id" => "y-axis-1",
|
|
|
"tick_config" => ["min" => 0, "max" => 100],
|
|
"tick_config" => ["min" => 0, "max" => 100],
|
|
@@ -821,7 +825,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
if($test_count === 0) continue;
|
|
if($test_count === 0) continue;
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle("$key_label $title Point of Challenge");
|
|
$chart->setTitle("$key_label $title Point of Challenge");
|
|
|
$chart->setLabels(["On Entry", "While Browsing", "During Play", "On Exit", "No Challenge"]);
|
|
$chart->setLabels(["On Entry", "While Browsing", "During Play", "On Exit", "No Challenge"]);
|
|
@@ -860,7 +864,7 @@ class ChartGenerator {
|
|
|
$data_values[] = ($total_test_count === 0) ? 0 : round(($total_pass_count * 100) / $total_test_count);
|
|
$data_values[] = ($total_test_count === 0) ? 0 : round(($total_pass_count * 100) / $total_test_count);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addXAxis([
|
|
$chart->addXAxis([
|
|
|
"type" => "category",
|
|
"type" => "category",
|
|
|
"scale_label_config" => [
|
|
"scale_label_config" => [
|
|
@@ -985,7 +989,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
public function getCleanlinessChart(): Chart {
|
|
public function getCleanlinessChart(): Chart {
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("doughnut");
|
|
$chart->setType("doughnut");
|
|
|
$chart->setTitle("Tests by Cleanliness ({$this->dateRangeLabel})");
|
|
$chart->setTitle("Tests by Cleanliness ({$this->dateRangeLabel})");
|
|
|
$chart->setLabels(["Very dirty", "Dirty", "Adequate", "Clean", "Very Clean"]);
|
|
$chart->setLabels(["Very dirty", "Dirty", "Adequate", "Clean", "Very Clean"]);
|
|
@@ -1026,7 +1030,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
if($period_data->testCount === 0) continue;
|
|
if($period_data->testCount === 0) continue;
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle("$key_label Cleanliness");
|
|
$chart->setTitle("$key_label Cleanliness");
|
|
|
$chart->setLabels(["Very dirty", "Dirty", "Adequate", "Clean", "Very Clean"]);
|
|
$chart->setLabels(["Very dirty", "Dirty", "Adequate", "Clean", "Very Clean"]);
|
|
@@ -1059,7 +1063,7 @@ class ChartGenerator {
|
|
|
$no_counts = array_column($staff_badge_worn_counts, 1);
|
|
$no_counts = array_column($staff_badge_worn_counts, 1);
|
|
|
$yes_counts = array_column($staff_badge_worn_counts, 2);
|
|
$yes_counts = array_column($staff_badge_worn_counts, 2);
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
$chart->setTitle("Staff Badge Worn by {$this->resolutionName}");
|
|
$chart->setTitle("Staff Badge Worn by {$this->resolutionName}");
|
|
|
$chart->setLabels($this->xDataLabels);
|
|
$chart->setLabels($this->xDataLabels);
|
|
@@ -1101,7 +1105,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
if($period_data->testCount === 0) continue;
|
|
if($period_data->testCount === 0) continue;
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle("$key_label Staff Behaviour");
|
|
$chart->setTitle("$key_label Staff Behaviour");
|
|
|
$chart->setLabels(["N/A", "Rude", "Slightly rude", "Neither rude or polite", "Polite", "Very polite"]);
|
|
$chart->setLabels(["N/A", "Rude", "Slightly rude", "Neither rude or polite", "Polite", "Very polite"]);
|
|
@@ -1276,7 +1280,7 @@ class ChartGenerator {
|
|
|
$no_counts = array_column($values, 0);
|
|
$no_counts = array_column($values, 0);
|
|
|
$yes_counts = array_column($values, 1);
|
|
$yes_counts = array_column($values, 1);
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
$chart->setTitle("{$title} by {$this->resolutionName}");
|
|
$chart->setTitle("{$title} by {$this->resolutionName}");
|
|
|
$chart->setLabels($this->xDataLabels);
|
|
$chart->setLabels($this->xDataLabels);
|
|
@@ -1292,7 +1296,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
private function getPeriodicPassRateChart(string $title, array $yes_rates, array $no_rates, ?array $null_rates = null): Chart {
|
|
private function getPeriodicPassRateChart(string $title, array $yes_rates, array $no_rates, ?array $null_rates = null): Chart {
|
|
|
|
|
|
|
|
- $chart = new Chart;
|
|
|
|
|
|
|
+ $chart = new Chart();
|
|
|
$chart->addYAxis([
|
|
$chart->addYAxis([
|
|
|
"tick_config" => ["min" => 0, "max" => 100],
|
|
"tick_config" => ["min" => 0, "max" => 100],
|
|
|
]);
|
|
]);
|