summaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-09-04 16:39:27 +0000
committerRomain d'Alverny <rda@mageia.org>2012-09-04 16:39:27 +0000
commit7e0eaf6c7ce99b02d2a73b68d687a20d8a547c6f (patch)
tree1b749723bc358a4cebfb2a4a7a368fcedd658d4d /lib.php
parentfec4435bf491d058bb7d71a6493bb23c4407133d (diff)
downloadpkgsubmit-7e0eaf6c7ce99b02d2a73b68d687a20d8a547c6f.tar
pkgsubmit-7e0eaf6c7ce99b02d2a73b68d687a20d8a547c6f.tar.gz
pkgsubmit-7e0eaf6c7ce99b02d2a73b68d687a20d8a547c6f.tar.bz2
pkgsubmit-7e0eaf6c7ce99b02d2a73b68d687a20d8a547c6f.tar.xz
pkgsubmit-7e0eaf6c7ce99b02d2a73b68d687a20d8a547c6f.zip
add packagers piechart
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