|
@@ -218,10 +218,10 @@ class ChartGenerator {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Charts
|
|
// Charts
|
|
|
- public function getTestsByStageChart(array $labels): 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("Tests by Stage ({$this->dateRangeLabel})");
|
|
|
|
|
|
|
+ $chart->setTitle("$title ({$this->dateRangeLabel})");
|
|
|
$chart->setLabels($labels);
|
|
$chart->setLabels($labels);
|
|
|
$chart->addDataset("Tests", [
|
|
$chart->addDataset("Tests", [
|
|
|
$this->totalData->stage1Count,
|
|
$this->totalData->stage1Count,
|
|
@@ -285,7 +285,7 @@ class ChartGenerator {
|
|
|
return $chart;
|
|
return $chart;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getPassFailCountChart(): Chart {
|
|
|
|
|
|
|
+ public function getPassFailCountChart(string $title = "Pass / Fail"): Chart {
|
|
|
$data = $this->totalData;
|
|
$data = $this->totalData;
|
|
|
|
|
|
|
|
$dataset = [$data->passCount, $data->failCount];
|
|
$dataset = [$data->passCount, $data->failCount];
|
|
@@ -300,7 +300,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
$chart = new Chart;
|
|
$chart = new Chart;
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
- $chart->setTitle("Pass / Fail ({$this->dateRangeLabel})");
|
|
|
|
|
|
|
+ $chart->setTitle("{$title} ({$this->dateRangeLabel})");
|
|
|
$chart->setLabels($labels);
|
|
$chart->setLabels($labels);
|
|
|
$chart->addDataset("Counts", $dataset, [
|
|
$chart->addDataset("Counts", $dataset, [
|
|
|
"background_colours" => $colours,
|
|
"background_colours" => $colours,
|
|
@@ -342,7 +342,7 @@ class ChartGenerator {
|
|
|
return $chart;
|
|
return $chart;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getPeriodicPassFailRateChart(): Chart {
|
|
|
|
|
|
|
+ public function getPeriodicPassFailRateChart(string $title = "Pass / Fail"): Chart {
|
|
|
|
|
|
|
|
$chart = new Chart;
|
|
$chart = new Chart;
|
|
|
$chart->addXAxis([
|
|
$chart->addXAxis([
|
|
@@ -356,7 +356,7 @@ class ChartGenerator {
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
- $chart->setTitle("Pass / Fail by {$this->resolutionName}");
|
|
|
|
|
|
|
+ $chart->setTitle("{$title} by {$this->resolutionName}");
|
|
|
$chart->setLabels($this->xDataLabels);
|
|
$chart->setLabels($this->xDataLabels);
|
|
|
$chart->addDataset("Pass Rate (%)", $this->getPeriodicPassRates(), [
|
|
$chart->addDataset("Pass Rate (%)", $this->getPeriodicPassRates(), [
|
|
|
"background_colours" => self::COLOUR_GREEN
|
|
"background_colours" => self::COLOUR_GREEN
|
|
@@ -414,10 +414,10 @@ class ChartGenerator {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getPeriodicLineOfSightPassRateChart(): Chart {
|
|
|
|
|
|
|
+ public function getPeriodicLineOfSightPassRateChart(string $title = "Pass Rate by Line of Sight"): Chart {
|
|
|
|
|
|
|
|
return $this->getPeriodicPassRateChart(
|
|
return $this->getPeriodicPassRateChart(
|
|
|
- "Pass Rate by Line of Sight",
|
|
|
|
|
|
|
+ $title,
|
|
|
$this->getPeriodicPassRateByLineOfSight(1),
|
|
$this->getPeriodicPassRateByLineOfSight(1),
|
|
|
$this->getPeriodicPassRateByLineOfSight(0),
|
|
$this->getPeriodicPassRateByLineOfSight(0),
|
|
|
$this->getPeriodicPassRateByLineOfSight(2)
|
|
$this->getPeriodicPassRateByLineOfSight(2)
|
|
@@ -510,7 +510,7 @@ class ChartGenerator {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getPeriodicTotalsChart(): Chart {
|
|
|
|
|
|
|
+ public function getPeriodicTotalsChart(string $title = "Totals"): Chart {
|
|
|
|
|
|
|
|
$test_counts = $this->getPeriodicTestCounts();
|
|
$test_counts = $this->getPeriodicTestCounts();
|
|
|
$pass_rates = $this->getPeriodicPassRates();
|
|
$pass_rates = $this->getPeriodicPassRates();
|
|
@@ -519,7 +519,7 @@ class ChartGenerator {
|
|
|
|
|
|
|
|
$chart = new Chart;
|
|
$chart = new Chart;
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
- $chart->setTitle("Totals by {$this->resolutionName}");
|
|
|
|
|
|
|
+ $chart->setTitle("{$title} by {$this->resolutionName}");
|
|
|
$chart->setLabels($this->xDataLabels);
|
|
$chart->setLabels($this->xDataLabels);
|
|
|
$chart->addYAxis([
|
|
$chart->addYAxis([
|
|
|
"id" => "y-axis-1",
|
|
"id" => "y-axis-1",
|
|
@@ -636,7 +636,7 @@ class ChartGenerator {
|
|
|
return $chart;
|
|
return $chart;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getPeriodicTestCountChart(): Chart {
|
|
|
|
|
|
|
+ public function getPeriodicTestCountChart(string $title = "Tests"): Chart {
|
|
|
$test_counts = $this->getPeriodicTestCounts();
|
|
$test_counts = $this->getPeriodicTestCounts();
|
|
|
$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;
|
|
@@ -652,7 +652,7 @@ class ChartGenerator {
|
|
|
"position" => "right"
|
|
"position" => "right"
|
|
|
]);
|
|
]);
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
- $chart->setTitle("Tests by {$this->resolutionName}");
|
|
|
|
|
|
|
+ $chart->setTitle("{$title} by {$this->resolutionName}");
|
|
|
$chart->setLabels($this->xDataLabels);
|
|
$chart->setLabels($this->xDataLabels);
|
|
|
$chart->addDataset("Tests", $test_counts, [
|
|
$chart->addDataset("Tests", $test_counts, [
|
|
|
"background_colours" => self::COLOUR_BLUE
|
|
"background_colours" => self::COLOUR_BLUE
|