From f417d2b25b9c31fb930b2bab7fe73c86d52600f9 Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Sun, 16 Feb 2025 15:25:27 +0000
Subject: [PATCH] 98_SVG.pm: add axis_width Attribute (Forum #140769)
git-svn-id: https://svn.fhem.de/fhem/trunk@29659 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/98_SVG.pm | 45 ++++++++++++++++++++++++++++++---------------
1 file changed, 30 insertions(+), 15 deletions(-)
diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm
index d3b773f65..c08b352e3 100644
--- a/fhem/FHEM/98_SVG.pm
+++ b/fhem/FHEM/98_SVG.pm
@@ -69,6 +69,7 @@ SVG_Initialize($)
$hash->{DefFn} = "SVG_Define";
no warnings 'qw';
my @attrList = qw(
+ axis_width
captionLeft:1,0"
captionPos:right,left,auto
endPlotNow:1,0
@@ -1444,7 +1445,7 @@ SVG_render($$$$$$$$$$)
$use_right_axis = $nr_right_axis if( !defined($use_right_axis) );
my $th = 16; # "Font" height
- my $axis_width = ($SVG_ss ? 2 : 3)*$th;
+ my $axis_width = AttrVal($name, "axis_width", ($SVG_ss ? 2 : 3)*$th);
my ($x, $y) = ($axis_width*$nr_left_axis, 1.2*$th); # Rect offset
######################
@@ -2621,6 +2622,27 @@ plotAsPng(@)
Attributes
+
+ - axis_width
+ Distance left and right used for displaying the value range.
+ If not specified, it is 48 for desktop and 32 for smallscreen.
+
+
+
+ - captionLeft
+ Show the legend on the left side (deprecated, will be autoconverted to
+ captionPos)
+
+
+
+ - captionPos
+ right - Show the legend on the right side (default)
+ left - Show the legend on the left side
+ auto - Show the legend labels on the left or on the right side depending
+ on the axis it belongs to
+
+
+
- endPlotNow
If this attribute is set to 1, then day and hour plots will
@@ -2642,20 +2664,6 @@ plotAsPng(@)
end today. Else the current week or the current month will be shown.
-
- - captionLeft
- Show the legend on the left side (deprecated, will be autoconverted to
- captionPos)
-
-
-
- - captionPos
- right - Show the legend on the right side (default)
- left - Show the legend on the left side
- auto - Show the legend labels on the left or on the right side depending
- on the axis it belongs to
-
-
- fixedrange [offset]
Contains two time specs in the form YYYY-MM-DD separated by a space.
@@ -2913,6 +2921,13 @@ plotAsPng(@)
Attribute
+
+ - axis_width
+ Abstand reserviert für die Darstellung der Messgrößen.
+ Falls nicht gesetzt, wird 48 für Desktop und 32 für
+ smallscreen verwendet.
+
+
- captionLeft
Anzeigen der Legende auf der linken Seite. Überholt, wird