|
|
@@ -443,10 +443,70 @@ if($submit) {
|
|
|
"#F44336",
|
|
|
],
|
|
|
"datalabels" => [
|
|
|
- "textAlign" => "center"
|
|
|
+ "display" => false,
|
|
|
],
|
|
|
]);
|
|
|
- $chart->setDatalabelFormatterCallback("testsByStageFormatter");
|
|
|
+
|
|
|
+ // Generate table
|
|
|
+ ob_start();
|
|
|
+ ?>
|
|
|
+
|
|
|
+ <table class="table table-sm small table-bordered mt-3">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th></th>
|
|
|
+ <th>Stage 1</th>
|
|
|
+ <th>Stage 2</th>
|
|
|
+ <th>Stage 3</th>
|
|
|
+ <th>Stage 4</th>
|
|
|
+ <th>Stage 5</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <?php
|
|
|
+ foreach(["value", "percent"] as $field) {
|
|
|
+
|
|
|
+ switch($field) {
|
|
|
+ case "value": $label = "Test Count"; break;
|
|
|
+ case "percent": $label = "Percentage"; break;
|
|
|
+ }
|
|
|
+
|
|
|
+ ?>
|
|
|
+ <tr>
|
|
|
+ <td><?=htmlspecialchars($label)?></td>
|
|
|
+ <?php
|
|
|
+ foreach(range(1, 5) as $stage) {
|
|
|
+
|
|
|
+ $key = "stage{$stage}Count";
|
|
|
+ $count = $total_data->{$key};
|
|
|
+
|
|
|
+ switch($field) {
|
|
|
+ case "value":
|
|
|
+ $string = $count;
|
|
|
+ break;
|
|
|
+ case "percent":
|
|
|
+ $string = (floor(($count * 10000) / $test_count) / 100) . "%";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ ?>
|
|
|
+ <td class="text-right"><?=$string?></td>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </tr>
|
|
|
+ <?php
|
|
|
+
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <?php
|
|
|
+ $html = ob_get_clean();
|
|
|
+
|
|
|
+ $chart->setAfterHtml($html);
|
|
|
+
|
|
|
$charts[] = $chart;
|
|
|
|
|
|
|