summaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib.php b/lib.php
index b00244e..24eda84 100644
--- a/lib.php
+++ b/lib.php
@@ -263,6 +263,7 @@ function drawChart() {
draw_status_chart();
draw_buildtime_chart();
draw_buildschedule_chart();
+ draw_packagers_chart();
}
S;
}
@@ -296,6 +297,35 @@ S;
return $s;
}
+ public static function js_draw_packagers_chart($data, $id)
+ {
+ $rows = array();
+ foreach ($data as $packager => $count) {
+ $rows[] = sprintf("['%s', %d]", $packager, $count);
+ }
+ $rows = implode(', ', $rows);
+ $s = <<<S
+function draw_packagers_chart() {
+ var data = new google.visualization.DataTable();
+ data.addColumn('string', 'Packagers');
+ data.addColumn('number', 'Packages');
+ data.addRows([{$rows}]);
+
+ var options = {
+ 'title':'Packagers',
+ 'width':600,
+ 'height':200,
+ 'backgroundColor': '#f8f8f8',
+ 'sliceVisibilityThreshold': 1/720
+ };
+
+ var chart = new google.visualization.PieChart(document.getElementById('{$id}'));
+ chart.draw(data, options);
+}
+S;
+ return $s;
+ }
+
public static function js_draw_buildtime_chart($data, $id)
{
// first pass