From df21f559cc4ea21b88ed69c547d19025365e1935 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 7 Jun 2018 10:18:21 +0000 Subject: [PATCH] 98_SVG.pm: add ysprintf option to the .gplot file (Forum #88460) git-svn-id: https://svn.fhem.de/fhem/trunk@16830 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_SVG.pm | 3 ++- fhem/www/gplot/SVG_01_Garden.gplot | 1 + fhem/www/gplot/SVG_02_Cellar.gplot | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm index 6770fd999..ad5834fce 100644 --- a/fhem/FHEM/98_SVG.pm +++ b/fhem/FHEM/98_SVG.pm @@ -1904,7 +1904,8 @@ SVG_render($$$$$$$$$$) } $off2 += $th/4; #-- text - my $txt = sprintf("%g", $i); + my $name = ($axis==1 ? "y":"y$axis")."sprintf"; # Forum #88460 + my $txt = sprintf($conf{$name} ? $conf{$name} : "%g", $i); SVG_pO "$txt"; } diff --git a/fhem/www/gplot/SVG_01_Garden.gplot b/fhem/www/gplot/SVG_01_Garden.gplot index db750ef46..1c2faf062 100644 --- a/fhem/www/gplot/SVG_01_Garden.gplot +++ b/fhem/www/gplot/SVG_01_Garden.gplot @@ -10,6 +10,7 @@ set y2tics set grid set ylabel "Rain (mm)" set y2label "Temperature" +set ysprintf %.2f #Log.Garden 4:Garden.T\x3a:15: #Log.Garden 10:Garden.T\x3a:0:delta-h diff --git a/fhem/www/gplot/SVG_02_Cellar.gplot b/fhem/www/gplot/SVG_02_Cellar.gplot index f804ce1ed..8ca3135b1 100644 --- a/fhem/www/gplot/SVG_02_Cellar.gplot +++ b/fhem/www/gplot/SVG_02_Cellar.gplot @@ -10,6 +10,7 @@ set y2tics set grid set ylabel "Humidity" set y2label "Temperature" +set ysprintf %.1f #Log.Cellar 4:Cellar.T\x3a:10: #Log.Cellar 6:Cellar.T\x3a:10: