2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 10:46:03 +00:00

98_SVG.pm/01_FHEMWEB.pm: plotWeekStartDay Attribut (Forum #37942)

git-svn-id: https://svn.fhem.de/fhem/trunk@9354 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-10-03 12:47:30 +00:00
parent 8dbbeaac6d
commit e38aa22d3b
2 changed files with 38 additions and 8 deletions

View File

@ -159,6 +159,7 @@ FHEMWEB_Initialize($)
plotmode:gnuplot,gnuplot-scroll,SVG
plotEmbed:0,1
plotsize
plotWeekStartDay:0,1,2,3,4,5,6
nrAxis
redirectCmds:0,1
refresh
@ -2885,8 +2886,8 @@ FW_widgetOverride($$)
<a name="endPlotToday"></a>
<li>endPlotToday<br>
If this FHEMWEB attribute is set to 1, then week and month plots will
end today. Else the current week (starting at Sunday) or the current
month will be shown.<br>
end today. Else the current week or the current month will be shown.
<br>
</li><br>
<a name="endPlotNow"></a>
@ -2926,6 +2927,11 @@ FW_widgetOverride($$)
makes the plotfork attribute meaningless.<br>
</li><br>
<a name="plotWeekStartDay"></a>
<li>plotWeekStartDay<br>
Start the week-zoom of the SVG plots with this day.
0 is Sunday, 1 is Monday, etc.<br>
</li><br>
<a name="basicAuth"></a>
<li>basicAuth, basicAuthMsg<br>
@ -3613,6 +3619,11 @@ FW_widgetOverride($$)
wirkungslos macht.
</li><br>
<a name="plotWeekStartDay"></a>
<li>plotWeekStartDay<br>
Starte das Plot in der Wochen-Ansicht mit diesem Tag.
0 ist Sonntag, 1 ist Montag, usw.
</li><br>
<a name="basicAuth"></a>
<li>basicAuth, basicAuthMsg<br>

View File

@ -56,9 +56,23 @@ SVG_Initialize($)
my ($hash) = @_;
$hash->{DefFn} = "SVG_Define";
$hash->{AttrList} = "fixedoffset fixedrange startDate plotsize nrAxis ".
"endPlotNow endPlotToday ".
"label title plotfunction captionLeft:1,0";
no warnings 'qw';
my @attrList = qw(
captionLeft:1,0"
endPlotNow
endPlotToday
fixedoffset
fixedrange
label
nrAxis
plotWeekStartDay:0,1,2,3,4,5,6
plotfunction
plotsize
startDate
title
);
use warnings 'qw';
$hash->{AttrList} = join(" ", @attrList);
$hash->{SetFn} = "SVG_Set";
$hash->{FW_summaryFn} = "SVG_FwFn";
$hash->{FW_detailFn} = "SVG_FwFn";
@ -913,7 +927,9 @@ SVG_calcOffsets($$)
} elsif($zoom eq "week") {
my @l = localtime($now);
my $start = (SVG_Attr($FW_wname, $wl, "endPlotToday", undef) ? 6 : $l[6]);
my $start = (SVG_Attr($FW_wname, $wl, "endPlotToday", undef) ?
6 : $l[6] - SVG_Attr($FW_wname, $wl, "plotWeekStartDay", 0));
$start += 7 if($start < 0);
my $t = $now - ($start*86400) + ($off*86400)*7;
@l = localtime($t);
$SVG_devs{$d}{from} = SVG_tspec(3,0,@l);
@ -2322,8 +2338,11 @@ plotAsPng(@)
</li><br>
<li><a href="#plotsize">plotsize</a></li><br>
<li><a href="#plotmode">plotmode</a></li><br>
<li><a href="#endPlotNow">endPlotNow</a></li><br>
<li><a href="#endPlotToday">endPlotToday</a></li><br>
<li><a href="#plotWeekStartDay">plotWeekStartDay</a></li><br>
<a name="label"></a>
<li>label<br>
@ -2519,10 +2538,10 @@ plotAsPng(@)
</li><br>
<li><a href="#plotsize">plotsize</a></li><br>
<li><a href="#plotmode">plotmode</a></li><br>
<li><a href="#endPlotNow">endPlotNow</a></li><br>
<li><a href="#endPlotToday">endPlotToday</a></li><br>
<li><a href="#plotWeekStartDay">plotWeekStartDay</a></li><br>
<a name="label"></a>
<li>label<br>