X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/e4e1557426f8e5ca10ca616140528939d86426cd..2af24084f6a12980933eabb23d3bde41b8fd1a1f:/web/image.php?ds=inline diff --git a/web/image.php b/web/image.php index eaa6fda..0e513a1 100644 --- a/web/image.php +++ b/web/image.php @@ -93,7 +93,7 @@ if ($type and $param) { if ($curr>$to) { - $cachefilename='meteo.'.$sensor.'.'.$param.'.'.$from.'-'.$to.'.'.$img_format; + $cachefilename='meteo.'.$sensor.'.'.$param.'.'.$to_unit.'.'.$from.'-'.$to.'.'.$img_format; } @@ -135,7 +135,7 @@ if ($type and $param) { $total_weight=0; $sum=0; - $maxdelta = 900; + $maxdelta = 1800; for ($j = $i; $j < count($xdata); ++$j) { @@ -167,13 +167,14 @@ if ($type and $param) { // Create the graph $g->graph_theme = null; - //$g->img->SetAntiAliasing(); + $g->img->SetAntiAliasing(); - // We need a linlin scale since we provide both - // x and y coordinates for the data points. + // We need a datlin scale since we provide both + // x and y coordinates for the data points, but x is unix timestamp. $g->SetScale('datlin'); $g->xaxis->SetLabelAngle(90); $g->xaxis->SetPos("min"); + $g->xaxis->scale->SetTimeAlign( HOURADJ_1 ); // We use a scatterplot to illustrate the original // contro points. @@ -196,6 +197,11 @@ if ($type and $param) { $g->title->SetFont(FF_DV_SANSSERIF,FS_BOLD,12); $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();