X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/6c7c64de24a54d6bea09cb5a179d3a4c630c13ef..a26fd989812acc9c3b91360a12a2685589acd942:/web/image.php diff --git a/web/image.php b/web/image.php index 16fbafb..9b6ca84 100644 --- a/web/image.php +++ b/web/image.php @@ -1,6 +1,6 @@ <?php // content="text/plain; charset=utf-8" -error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE); +error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_DEPRECATED); include ('config_local.php'); @@ -12,7 +12,7 @@ require_once ('jpgraph/jpgraph_regstat.php'); if (! ($db = new PDO("mysql:host=$mysql_host;port=$mysql_port;dbname=$mysql_schema",$mysql_user,$mysql_pwd,array( PDO::ATTR_PERSISTENT => false)))) { - die('Ðе Ð¼Ð¾Ð³Ñ Ð¿Ð¾Ð´ÐºÐ»ÑÑиÑÑÑÑ Ðº ÐÐ'); + die('ÃÂõ üþóÃÆ Ã¿Ã¾Ã´ÃºÃ»ÃŽÃâ¡Ã¸ÃâÃÅÃÂàú ÃâÃâ'); } @@ -65,12 +65,13 @@ if ($type and $param) { } $q = $db -> prepare( - 'select u.name_short from units u where u.id='.$to_unit + 'select u.name_short,u.prec from units u where u.id='.$to_unit ); $q -> execute(); while ($row = $q -> fetch(PDO::FETCH_ASSOC)) { $param_unit = $row['name_short']; + $precision = $row['prec']; } $xdata = array(); @@ -198,18 +199,24 @@ if ($type and $param) { $g->xaxis->HideLabels(True); } $g->xaxis->SetPos("min"); + $g->yaxis->SetLabelFormat("%0.".$precision."f"); # $g->xaxis->scale->SetTimeAlign( HOURADJ_1 ); - // We use a scatterplot to illustrate the original - // contro points. - $splot = new ScatterPlot($ydata,$xdata); - $g->Add($splot); - // - $splot->mark->SetFillColor($dot_color); - $splot->mark->SetColor($dot_color); - $splot->mark->SetType(MARK_FILLEDCIRCLE); - $splot->mark->SetSize(2); + if ($type!="last24small") { + + // We use a scatterplot to illustrate the original + // contro points. + $splot = new ScatterPlot($ydata,$xdata); + $g->Add($splot); + + // + $splot->mark->SetFillColor($dot_color); + $splot->mark->SetColor($dot_color); + $splot->mark->SetType(MARK_FILLEDCIRCLE); + $splot->mark->SetSize(2); + + } $fplot = new LinePlot($f_ydata,$xdata); $g->Add($fplot); @@ -234,7 +241,7 @@ if ($type and $param) { } else { header("Content-Type: text/html; charset=UTF-8"); - die('СенÑÐ¾Ñ Ð½Ðµ вÑбÑан!'); + die('áõýÃÂþÃ⬠ýõ òÃâ¹Ã±Ãâ¬Ã°Ã½!'); }