X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/6f6f38ad845e089ef732873cfcf8e321d8cc1e38..2a8970b9871f3b8b5b84f382c14a728778b0ee9b:/web/image.php?ds=inline diff --git a/web/image.php b/web/image.php index bf511f2..9b6ca84 100644 --- a/web/image.php +++ b/web/image.php @@ -1,6 +1,6 @@ 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,6 +199,7 @@ if ($type and $param) { $g->xaxis->HideLabels(True); } $g->xaxis->SetPos("min"); + $g->yaxis->SetLabelFormat("%0.".$precision."f"); # $g->xaxis->scale->SetTimeAlign( HOURADJ_1 ); @@ -239,7 +241,7 @@ if ($type and $param) { } else { header("Content-Type: text/html; charset=UTF-8"); - die('Сенсор не выбран!'); + die('Сенсор не выбран!'); }