Workaround for broken data transmission from Arduino part
[weathermon.git] / web / image_minmax.php
index 3736221a4311b0941ef7f8bca6eb843a948c5db4..dfa66d202a3aecdafd81a7a7ef9faccfb734b0ca 100644 (file)
@@ -95,7 +95,7 @@ if ($type and $param) {
     
     if ($curr>$next_year.$next_month) {
     
-      $cachefilename='meteo.month.'.$sensor.'.'.$param.'.'.$year.'-'.$month.'.'.$img_format;
+      $cachefilename='meteo.month.'.$sensor.'.'.$param.'.'.$to_unit.'.'.$year.'-'.$month.'.'.$img_format;
     
     }
 
@@ -197,6 +197,7 @@ if ($type and $param) {
   $g->SetScale('datlin');
   $g->xaxis->SetLabelAngle(90);
   $g->xaxis->SetPos("min");
+  $g->xaxis->scale->SetTimeAlign( MINADJ_1 );
 
   // We use a scatterplot to illustrate the original
   // contro points.
@@ -204,14 +205,14 @@ if ($type and $param) {
   $bplot = new LinePlot($maxdata,$xdata);
   $g->Add($bplot);
   $bplot->SetColor($fill_color_top);
-  $bplot->SetFillGradient($fill_color_top,$fill_color_bottom,100,TRUE);
+  $bplot->SetFillGradient($fill_color_top.'@0.2',$fill_color_bottom.'@0.9',100,TRUE);
   $bplot->SetFillFromYMin(TRUE);       
   $bplot->SetWeight(4);
 
   $aplot = new LinePlot($mindata,$xdata);
   $g->Add($aplot);
   $aplot->SetColor($fill_color_bottom);
-  $aplot->SetFillGradient($fill_color_bottom,'white',100,TRUE);
+  $aplot->SetFillGradient($fill_color_bottom.'@0.2','white@0.9',100,TRUE);
   $aplot->SetFillFromYMin(TRUE);       
   $aplot->SetWeight(4);
 
@@ -222,6 +223,11 @@ if ($type and $param) {
   $g->subtitle->SetColor('darkred');
   $g->SetMarginColor('silver');
 
+  $g->xgrid->Show();
+  $g->xgrid->SetLineStyle('dotted');
+  $g->ygrid->Show();
+  $g->ygrid->SetLineStyle('dotted');
+        
   // Add the plots to the graph and stroke
   $g->Stroke();