X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/769d0bd71b19b467c195838379a379e0e2d69c2b..aa93d9c75aad23c01d984b780adf5e0ef4435bb1:/web/image.php 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('Сенсор не выбран!'); }