98_DOIF.pm cylinder: fixed position of the chart legend

git-svn-id: https://svn.fhem.de/fhem/trunk@26444 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Damian
2022-09-25 16:29:19 +00:00
parent 24fad38c14
commit 65e1e54691

View File

@@ -6244,7 +6244,7 @@ sub cylinder_mode
$out.= sprintf('<text x="%d" y="%d" style="fill:white; font-size:10px">%s</text>',$xBegin,$null+$heightoffset+2,0) if (defined $null); $out.= sprintf('<text x="%d" y="%d" style="fill:white; font-size:10px">%s</text>',$xBegin,$null+$heightoffset+2,0) if (defined $null);
$out.= sprintf('<text x="%d" y="%d" style="fill:white; font-size:10px">%s</text>',$xBegin,+$heightoffset,$max); $out.= sprintf('<text x="%d" y="%d" style="fill:white; font-size:10px">%s</text>',$xBegin,+$heightoffset,$max);
my $yBegin=13+($height-@values*$heightval)/2; my $yBegin=14+($height-@values*$heightval)/2;
my $xValue=$xLeft; my $xValue=$xLeft;
my $yValue=$yBegin+$heightval-1; my $yValue=$yBegin+$heightval-1;
my $val_sum_pos=0; my $val_sum_pos=0;
@@ -6276,14 +6276,14 @@ sub cylinder_mode
my $yText; my $yText;
if (defined $text and $text ne "") { if (defined $text and $text ne "") {
$out.= sprintf('<text x="%d" y="%d" style="fill:%s; font-size:12px">%s</text>',$xBegin+10,$yBegin+$i*$heightval,hsl_color($color),$text.":"); $out.= sprintf('<text x="%d" y="%d" style="fill:%s; font-size:12px">%s</text>',$xBegin+10,$yBegin+$i*$heightval,hsl_color($color),$text.":");
} else {
$yValue -=7;
}
if ($heightval == 10) { if ($heightval == 10) {
$yText=$yValue+7; $yText=$yValue+7;
} else { } else {
$yText=$yValue-4; $yText=$yValue-4;
} }
} else {
$yText=$yValue-4;
}
$out.= sprintf('<text text-anchor="end" x="%d" y="%d" style="fill:%s";><tspan style="font-size:14px;font-weight:bold;">%s</tspan><tspan dx="2" style="font-size:10px">%s</tspan></text>',$bwidth+5, $yText+$i*$heightval,hsl_color ($color),($val eq "N/A" ? $val:sprintf($format,$val)),$unit); $out.= sprintf('<text text-anchor="end" x="%d" y="%d" style="fill:%s";><tspan style="font-size:14px;font-weight:bold;">%s</tspan><tspan dx="2" style="font-size:10px">%s</tspan></text>',$bwidth+5, $yText+$i*$heightval,hsl_color ($color),($val eq "N/A" ? $val:sprintf($format,$val)),$unit);
if ($mode == 2) { if ($mode == 2) {
if ($value> 0) { if ($value> 0) {