SVN: toys/stbr/stats/top10specTitanium-dev.php

shadzik shadzik at pld-linux.org
Tue Aug 31 11:08:31 CEST 2010


Author: shadzik
Date: Tue Aug 31 11:08:31 2010
New Revision: 11798

Added:
   toys/stbr/stats/top10specTitanium-dev.php
Log:
- new for ti-dev


Added: toys/stbr/stats/top10specTitanium-dev.php
==============================================================================
--- (empty file)
+++ toys/stbr/stats/top10specTitanium-dev.php	Tue Aug 31 11:08:31 2010
@@ -0,0 +1,54 @@
+<?
+
+require_once("php-ofc-library/open-flash-chart.php");
+require_once("db.dat");
+
+$top = 10;
+$line = "ti-dev";
+
+$q = @$DBhandle->query('select spec, count(spec) AS c from application where line = "'.$line.'" group by spec order by c desc limit '.$top.';');
+
+$res = $q->fetchAll();
+$specs = array();
+$count = array();
+foreach ($res as $e) {
+	$specs[] = str_replace(".spec","",$e[0]);
+	$count[] = (int)$e[1];
+}
+
+$title = new title("Titanium Devel Top $top Most STBRed Specs");
+$chart = new open_flash_chart();
+$chart->set_title($title);
+
+$ranks = array();
+$bars = array();
+for ($i=0; $i<$top; $i++) {
+	$ranks[] = (string)($i+1);
+	$bar = new bar_value($count[$i]);
+	$bar->set_tooltip("$specs[$i], $count[$i]");
+	$bars[] = $bar;
+}
+
+$bar = new bar_3d();
+$bar->set_values($bars);
+$bar->set_colour('#006600');
+$chart->add_element($bar);
+
+$y = new y_axis();
+$y->set_range(0, max($count), 5);
+
+$xlabels = new x_axis_labels();
+$xlabels->set_labels($ranks);
+
+$xlegend = new x_legend('Rank');
+
+$x = new x_axis();
+$x->set_labels($xlabels);
+
+$chart->set_x_axis($x);
+$chart->set_y_axis($y);
+//$chart->set_x_legend($xlegend);
+
+echo $chart->toPrettyString();
+
+?>


More information about the pld-cvs-commit mailing list