better zoom
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 17 Jan 2005 00:48:43 +0000 (00:48 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:45 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-368

htdocs/stats/graph_evolution.php
htdocs/stats/graph_promo.php

index ddd8546..44224f4 100644 (file)
@@ -60,8 +60,9 @@ for ($i=-$JOURS;$i<=0;$i++) {
 //Genere le graphique à la volée avec GNUPLOT
 header( "Content-type: image/png");
 
-$ymin = round($init_nb*0.95,0);
-$ymax = round($total  *1.05,0);
+$delt = ($total - $init_nb)/10;
+$ymin = round($init_nb - $delt,0);
+$ymax = round($total   + $delt,0);
 
 $gnuplot = <<<EOF2
 gnuplot <<EOF
index 67882d2..03fc4ac 100644 (file)
@@ -61,8 +61,10 @@ for ($i=-$JOURS;$i<=0;$i++) {
 //Genere le graphique à la volée avec GNUPLOT
 header( "Content-type: image/png");
 
-$ymin = round($init_nb*0.95,0);
-$ymax = round($total  *1.05,0);
+$delt = ($total - $init_nb) / 10;
+$delt += ($delt < 1);
+$ymin = round($init_nb - $delt,0);
+$ymax = round($total   + $delt,0);
 
 $gnuplot = <<<EOF2
 gnuplot <<EOF