X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/6f6f38ad845e089ef732873cfcf8e321d8cc1e38..b0a690ee18f5c2f894edc7c30fd6204c262670fe:/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 @@
 <?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,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('Сенсор не выбран!');
 
 }