|
|
@@ -349,6 +349,7 @@ if($submit) {
|
|
|
|
|
|
$stage_key = "stage" . $test->challenge_stage . "Count";
|
|
|
$data[$key]->$stage_key++;
|
|
|
+ $total_data->{$stage_key}++;
|
|
|
|
|
|
if($test->pass) {
|
|
|
$data[$key]->passCount++;
|
|
|
@@ -426,13 +427,13 @@ if($submit) {
|
|
|
$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->setLabels(["1 - On Entry", "2 - While Browsing", "3 - During Play", "4 - On Exit", "5 - 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")),
|
|
|
+ $total_data->stage1Count,
|
|
|
+ $total_data->stage2Count,
|
|
|
+ $total_data->stage3Count,
|
|
|
+ $total_data->stage4Count,
|
|
|
+ $total_data->stage5Count,
|
|
|
], [
|
|
|
"background_colours" => [
|
|
|
"#4CAF50",
|
|
|
@@ -440,9 +441,12 @@ if($submit) {
|
|
|
"#FBC02D",
|
|
|
"#FFAB91",
|
|
|
"#F44336",
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ "datalabels" => [
|
|
|
+ "textAlign" => "center"
|
|
|
+ ],
|
|
|
]);
|
|
|
- $chart->setDatalabelSuffixes(" Test");
|
|
|
+ $chart->setDatalabelFormatterCallback("testsByStageFormatter");
|
|
|
$charts[] = $chart;
|
|
|
|
|
|
|