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

Small fixes / avg_month gnuplot

git-svn-id: https://svn.fhem.de/fhem/trunk@220 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2008-08-01 07:44:06 +00:00
parent ac6f312b51
commit 056fc174de
5 changed files with 35 additions and 4 deletions

View File

@ -294,7 +294,7 @@ SVG_render($$$$$$$)
pO "<polyline points=\"$ret\" class=\"l$idx\"/>\n";
}
} elsif($type[$idx] eq "steps" ) {
} elsif($type[$idx] eq "steps" || $type[$idx] eq "fsteps" ) {
if(@{$dxp} == 1) {
my $y1 = $y+$h-($dyp->[0]-$min)*$hmul;
@ -306,7 +306,11 @@ SVG_render($$$$$$$)
my ($x2, $y2) = ($x+$dxp->[$i], $y+$h-($dyp->[$i] -$min)*$hmul);
next if(int($x2) == $lx && int($y1) == $ly);
$lx = int($x2); $ly = int($y2);
$ret .= sprintf(" %d,%d %d,%d %d,%d", $x1,$y1, $x2,$y1, $x2,$y2);
if($type[$idx] eq "steps") {
$ret .= sprintf(" %d,%d %d,%d %d,%d", $x1,$y1, $x2,$y1, $x2,$y2);
} else {
$ret .= sprintf(" %d,%d %d,%d %d,%d", $x1,$y1, $x1,$y2, $x2,$y2);
}
}
}
pO "<polyline points=\"$ret\" class=\"l$idx\"/>\n";

View File

@ -2,6 +2,8 @@
# Display the temperature and the humidity values of a KS300.
# Corresponding FileLog definition:
# define ks300log FileLog /var/log/fhem/ks300-%Y-%U.log ks300:.*H:.*
# or (SVG/gnuplot-scroll)
# define ks300log FileLog /var/log/fhem/ks300-%Y.log ks300:.*H:.*
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'

View File

@ -2,6 +2,8 @@
# Display the Wind and the Rain values of a KS300.
# Corresponding FileLog definition:
# define ks300log FileLog /var/log/fhem/ks300-%Y-%U.log ks300:.*H:.*
# or (SVG/gnuplot-scroll)
# define ks300log FileLog /var/log/fhem/ks300-%Y.log ks300:.*H:.*
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'

View File

@ -1,7 +1,7 @@
############################
# Display the Temperature and the humidity values of a KS300.
# Display the daily avarage temperature and rainfall from a KS300.
# Corresponding FileLog definition:
# define ks300log FileLog /var/log/fhem/ks300-%Y-%U.log ks300:.*H:.*
# define avglog FileLog /var/log/fhem/ks300-%Y.log ks300:.*avg.*
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'

View File

@ -0,0 +1,23 @@
############################
# Display the monthly avarage temperature and rainfall from a KS300.
# Corresponding FileLog definition:
# define avglog FileLog /var/log/fhem/ks300-%Y.log ks300:.*avg.*
set terminal png transparent size <SIZE> crop
set output '<OUT>.png'
set xdata time
set timefmt "%Y-%m-%d_%H:%M:%S"
set xlabel " "
set ytics nomirror
set y2tics
set title '<TL>'
set grid
set ylabel "Temperature in C"
set y2label "Rain (l/m2)"
#FileLog 5:avg_month:0:
#FileLog 11:avg_month:0:
plot "<grep avg_month <IN>" using 1:5 axes x1y1 title 'Temperature' with lines,\
"<grep avg_month <IN>" using 1:11 axes x1y2 title 'Rain' with fsteps