mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
98_SVG.pm: add plotAsPngFix attribute (Forum #116138)
git-svn-id: https://svn.fhem.de/fhem/trunk@25742 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c6ceb30ad0
commit
29f27c38e1
@ -82,6 +82,7 @@ SVG_Initialize($)
|
||||
plotmode:gnuplot-scroll,gnuplot-scroll-svg,SVG
|
||||
plotsize
|
||||
plotReplace:textField-long
|
||||
plotAsPngFix:1,0
|
||||
startDate
|
||||
title
|
||||
);
|
||||
@ -2453,19 +2454,22 @@ plotAsPng(@)
|
||||
}
|
||||
}
|
||||
|
||||
my $svgName = $plotName[0];
|
||||
$FW_RET = undef;
|
||||
$FW_webArgs{dev} = $plotName[0];
|
||||
$FW_webArgs{logdev} = InternalVal($plotName[0], "LOGDEVICE", "");
|
||||
$FW_webArgs{gplotfile} = InternalVal($plotName[0], "GPLOTFILE", "");
|
||||
$FW_webArgs{logfile} = InternalVal($plotName[0], "LOGFILE", "CURRENT");
|
||||
$FW_webArgs{dev} = $svgName;
|
||||
$FW_webArgs{logdev} = InternalVal($svgName, "LOGDEVICE", "");
|
||||
$FW_webArgs{gplotfile} = InternalVal($svgName, "GPLOTFILE", "");
|
||||
$FW_webArgs{logfile} = InternalVal($svgName, "LOGFILE", "CURRENT");
|
||||
$FW_pos{zoom} = $plotName[1] if $plotName[1];
|
||||
$FW_pos{off} = $plotName[2] if $plotName[2];
|
||||
|
||||
($mimetype, $svgdata) = SVG_showLog("unused");
|
||||
|
||||
my ($w, $h) = split(",", AttrVal($plotName[0],"plotsize","800,160"));
|
||||
my ($w, $h) = split(",", AttrVal($svgName,"plotsize","800,160"));
|
||||
$svgdata =~ s/<\/svg>/<polyline opacity="0" points="0,0 $w,$h"\/><\/svg>/;
|
||||
# $svgdata =~ s/\.SVGplot\./\./g; # Forum #116138 / "corrupt" CSS: why?
|
||||
|
||||
# Forum #32791,#116138: some lib versions cannot parse complex CSS selectors
|
||||
$svgdata =~ s/\.SVGplot\./\./g if(AttrVal($svgName, "plotAsPngFix", 0));
|
||||
|
||||
eval {
|
||||
require Image::LibRSVG;
|
||||
@ -2638,6 +2642,14 @@ plotAsPng(@)
|
||||
1,1.
|
||||
</li><br>
|
||||
|
||||
<a id="SVG-attr-plotAsPngFix"></a>
|
||||
<li>plotAsPngFix [0|1]<br>
|
||||
Affects only the plotAsPng function: Some LibRSVG versions cannot cope
|
||||
with complex CSS selectors, so the resulting PNG is black and white
|
||||
only. If this attribute is set to 1, the CSS selector complexity will
|
||||
be reduced.
|
||||
</li><br>
|
||||
|
||||
<a id="SVG-attr-plotfunction"></a>
|
||||
<li>plotfunction<br>
|
||||
Space value separated list of values. The value will be used to replace
|
||||
@ -2915,6 +2927,13 @@ plotAsPng(@)
|
||||
Achse links, 1 Achse rechts).
|
||||
</li><br>
|
||||
|
||||
<a id="SVG-attr-plotAsPngFix"></a>
|
||||
<li>plotAsPngFix [0|1]<br>
|
||||
Betrifft nur die plotAsPng Funktion: Bestimmte LibRSVG Versionen
|
||||
können nicht mit komplexen CSS Selektoren umgehen, und das
|
||||
Ergebnis ist ein schwarz/weiß Bild. Falls dieses Attribut auf 1
|
||||
gesetzt wird, werden die CSS Anweisungen vereinfacht.
|
||||
</li><br>
|
||||
|
||||
<a id="SVG-attr-plotfunction"></a>
|
||||
<li>plotfunction<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user