From 13426e1a3df985b8547455b3a0257039653603f9 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Tue, 4 Sep 2012 15:28:57 +0000 Subject: try js charts --- lib.php | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) (limited to 'lib.php') diff --git a/lib.php b/lib.php index 48ec11f..5d1cfde 100644 --- a/lib.php +++ b/lib.php @@ -236,3 +236,113 @@ function build_stats($pkgs) $pkgs ); } + + +class mga_bs_charts +{ + + public static function js_init() + { + return << + +S; + } + + public static function js_draw_charts() + { + return << $count) { + $rows[] = sprintf("['%s', %d]", $status, $count); + } + $rows = implode(', ', $rows); + $s = << $count) { + $rows[] = sprintf("['%s', %d]", $duration, $count); + } + $rows = implode(', ', $rows); + return << $count) { + $rows[] = sprintf("['%s', %d]", $hour, $count); + } + $rows = implode(', ', $rows); + return <<