[Fusionforge-commits] r9016 - trunk/gforge/www/project/stats

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Wed Mar 10 21:50:52 CET 2010


Author: aljeux
Date: 2010-03-10 21:50:52 +0100 (Wed, 10 Mar 2010)
New Revision: 9016

Modified:
   trunk/gforge/www/project/stats/index.php
Log:
Improve quality of default value for SPAN in project stats to avoid bad looking graphs when lots of values.

Modified: trunk/gforge/www/project/stats/index.php
===================================================================
--- trunk/gforge/www/project/stats/index.php	2010-03-10 20:50:47 UTC (rev 9015)
+++ trunk/gforge/www/project/stats/index.php	2010-03-10 20:50:52 UTC (rev 9016)
@@ -39,6 +39,14 @@
 	$start = $z[count($z)-1];
 }
 
+// Find a default SPAN value depending on the number of days.
+$delta=($end - $start)/24/60/60;
+if (!$SPAN) {
+	$SPAN = 1;
+	if ($delta > 60) $SPAN=2;
+	if ($delta > 365) $SPAN=3;
+}
+
 site_project_header(array('title'=>_('Project Activity').' '.$group->getPublicName(),'group'=>$group_id,'toptab'=>'home'));
 
 $area = util_ensure_value_in_set ($area, array ('tracker','forum','docman','taskman','downloads')) ;




More information about the Fusionforge-commits mailing list