mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
98_SVG.pm: fix gnuplot-scroll and gnuplot-scroll-svg
git-svn-id: https://svn.fhem.de/fhem/trunk@16656 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ba206c4990
commit
cfe1ee51bd
@ -70,7 +70,7 @@ SVG_Initialize($)
|
|||||||
nrAxis
|
nrAxis
|
||||||
plotWeekStartDay:0,1,2,3,4,5,6
|
plotWeekStartDay:0,1,2,3,4,5,6
|
||||||
plotfunction
|
plotfunction
|
||||||
plotmode
|
plotmode:gnuplot-scroll,gnuplot-scroll-svg,SVG
|
||||||
plotsize
|
plotsize
|
||||||
plotReplace:textField-long
|
plotReplace:textField-long
|
||||||
startDate
|
startDate
|
||||||
@ -1163,22 +1163,24 @@ SVG_doShowLog($$$$;$)
|
|||||||
my $gplot_script = SVG_substcfg(0, $wl, $cfg, $plot, $file, $tmpfile);
|
my $gplot_script = SVG_substcfg(0, $wl, $cfg, $plot, $file, $tmpfile);
|
||||||
$gplot_script =~ s/<TMPFILE>/$tmpfile/g;
|
$gplot_script =~ s/<TMPFILE>/$tmpfile/g;
|
||||||
|
|
||||||
$plot =~ s/ls \w+//g;
|
|
||||||
open(FH, "|gnuplot >> $errfile 2>&1");# feed it to gnuplot
|
|
||||||
print FH $gplot_script;
|
|
||||||
close(FH);
|
|
||||||
unlink($tmpfile);
|
|
||||||
|
|
||||||
my $ext;
|
my $ext;
|
||||||
if($pm eq "gnuplot-scroll") {
|
if($pm eq "gnuplot-scroll") {
|
||||||
$FW_RETTYPE = "image/png";
|
$FW_RETTYPE = "image/png";
|
||||||
$ext = "png";
|
$ext = "png";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$gplot_script =~ s/set terminal png transparent/set terminal svg/;
|
||||||
|
$gplot_script =~ s/set terminal (.*) crop/set terminal $1/;
|
||||||
|
$gplot_script =~ s/set output (.*).png'/set output $1.svg'/;
|
||||||
$FW_RETTYPE = "image/svg+xml";
|
$FW_RETTYPE = "image/svg+xml";
|
||||||
$ext = "svg";
|
$ext = "svg";
|
||||||
}
|
}
|
||||||
|
$gplot_script =~ s/ls \w+//g;
|
||||||
|
open(FH, "|gnuplot >> $errfile 2>&1");# feed it to gnuplot
|
||||||
|
print FH $gplot_script;
|
||||||
|
close(FH);
|
||||||
|
unlink($tmpfile);
|
||||||
|
|
||||||
open(FH, "$tmpfile.$ext"); # read in the result and send it
|
open(FH, "$tmpfile.$ext"); # read in the result and send it
|
||||||
binmode (FH); # necessary for Windows
|
binmode (FH); # necessary for Windows
|
||||||
FW_pO join("", <FH>);
|
FW_pO join("", <FH>);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user