Alan Lam 8 лет назад
Родитель
Сommit
65655d24ce
1 измененных файлов с 23 добавлено и 0 удалено
  1. 23 0
      controllers/performance.php

+ 23 - 0
controllers/performance.php

@@ -410,6 +410,29 @@ if($submit) {
 			$current_period_name = "Q" . $current_quarter . " " . date("Y", $max_unix);
 		}
 
+		// Tests by Stage
+
+		$chart = new Chart;
+		$chart->setType("pie");
+		$chart->setTitle("Tests by Stage $date_range_label");
+		$chart->setLabels(["On Entry", "While Browsing", "During Play", "On Exit", "No Challenge"]);
+		$chart->addDataset("Counts", [
+			array_sum(array_column($data, "stage1Count")),
+			array_sum(array_column($data, "stage2Count")),
+			array_sum(array_column($data, "stage3Count")),
+			array_sum(array_column($data, "stage4Count")),
+			array_sum(array_column($data, "stage5Count")),
+		], [
+			"background_colours" => [
+				"#4CAF50",
+				"#FFEB3B",
+				"#FBC02D",
+				"#FFAB91",
+				"#F44336",
+			]
+		]);
+		$charts[] = $chart;
+
 
 		// Challenger Gender
 		$chart = new Chart;