X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/e4e1557426f8e5ca10ca616140528939d86426cd..e47039f4c6bd8d3d21d588211290385aa117e720:/web/image_minmax.php diff --git a/web/image_minmax.php b/web/image_minmax.php index 3736221..183942b 100644 --- a/web/image_minmax.php +++ b/web/image_minmax.php @@ -84,18 +84,19 @@ if ($type and $param) { $next_year = $year; $next_month = $month+1; - if ($month==13) { + if ($month==12) { $next_year++; $next_month=1; - + } $curr = date("Ym"); + $ym=sprintf('%04d%02d',$next_year,$next_month); - if ($curr>$next_year.$next_month) { + if ($curr>$ym) { - $cachefilename='meteo.month.'.$sensor.'.'.$param.'.'.$year.'-'.$month.'.'.$img_format; + $cachefilename='meteo.month.'.$sensor.'.'.$param.'.'.$to_unit.'.'.$year.'-'.$month.'.'.$img_format; } @@ -197,6 +198,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 +206,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 +224,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();