ich möchte die Tageswerte meiner PV-Anlagen vergleichen und hab keine vernünftige Darstellung (lines bars points steps ibars ...) in den Plots gefunden.
ich hab nun 98_SVG.pm leicht abgeändert und hab mir "needes" (= bars mit breite 1) gebaut.
needles.png
was haltet ihr davon?
98_SVG.pm
line 495
$o .= SVG_sel("type_${idx}",
"lines,points,steps,fsteps,histeps,bars,ibars,needles,".
"horizontalLineFrom,horizontalLineTo,".
"cubic,quadratic,quadraticSmooth",
$conf{lType}[$idx]);
einfügen line 2075
} elsif( $lType eq "needles" ) {
my $bw = 1;
# bars are all of equal width (see far above !),
# position rounded to integer multiples of bar width
foreach my $i (0..int(@{$dxp})-1) {
my ($x1, $y1) = ( $x + $dxp->[$i] - $bw,
$y +$h-($dyp->[$i]-$min)*$hmul);
my $curBw = $bw;
if($x1 < $x) {
$curBw -= $x - $x1;
$x1 = $x;
}
my ($x2, $y2) = ($curBw, ($dyp->[$i]-$min)*$hmul);
SVG_pO "<rect $attributes $lStyle x=\"$x1\" y=\"$y1\" ".
"width=\"$x2\" height=\"$y2\"/>";
}
Super, bin begeistert ;D Ich kenne das Problem vom Vergleichen verschiedener Tageswerte und fand die bisherigen Lösungen auch suboptimal (transparente Bars etc).
Habe die Funktionalitaet hinzugefuegt.
Da (soweit ich es beurteilen kann) der Kode eine Kopie von bars mit eine Zeile Aenderung ist, habe ich ihn etwas vereinfacht.
danke dir!
Super, ebenfalls danke von mir. Leider klappt das bei mir so nicht direkt, die "needles" überlagern sich (was glaub ich Sinn macht weil ich alle Daten zum gleichen Zeitpunkt geloggt habe). Wie hast du das so schön hinbekommen bei deinem Graph? Also dass die Needles nebeinander sind?
Screenshot 2024-03-10 200113.png
du musst die plots mit dem LogProxy-offset verschieben
#LogProxy FileLog:fl_pv_daily,offset=-3600*14:8:PlenticoreLogDay:0:$fld[7]/5.04
#LogProxy FileLog:fl_PvGriesslerWeg_daily,offset=-3600*10:4:PvGriesslerWeg_day.T\x3a:0:$fld[3]/0.840
#LogProxy FileLog:fl_pvCarport_daily,offset=-3600*6:8:PvCarportLogDay.*T\x3a:0:$fld[7]/340
#LogProxy FileLog:fl_simon_daily,offset=-3600*2:4:WrSimon_day.T\x3a:0:$fld[3]/0.150
#LogProxy ConstY:3.044
plot "<IN>" using 1:2 axes x1y1 title 'Piko' ls l1 lw 2.5 with needles,\
"<IN>" using 1:2 axes x1y2 title 'Griesslerweg' ls l4 lw 2.5 with needles,\
"<IN>" using 1:2 axes x1y2 title 'Carport' ls l7 lw 2.5 with needles,\
"<IN>" using 1:2 axes x1y2 title 'Simon' ls l6 lw 2.5 with needles,\
"<IN>" using 1:2 axes x1y2 title 'Jahresschnitt' ls l5dot lw 1.5 with lines
Super, danke dir
Edit: sehr schick aus, I love it, danke euch für die rasche Umsetzung!
Screenshot 2024-03-11 204945.png
Hallo an alle,
ich hoffe, es ist nicht falsch, hier nochmal zu schreiben.
Ich bekomme den Offset nicht hin:
Mein Plotfile sieht so aus:
# Created by FHEM/98_SVG.pm, 2024-05-03 17:27:07
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 title '<TL>'
set ytics
set y2tics
set grid
set ylabel "kWh"
set y2label "kWh"
#LogDB MQTT2_Solar:diff_hour_Hourlast_Production:::$val=$val/1000
#LogDB MQTT2_SolarDTU:diff_hour_Hourlast_Production_DTU:::$val=$val/1000
plot "<IN>" using 1:2 axes x1y2 title 'Shelly' ls l1fill_gyr lw 3 with needles,\
"<IN>" using 1:2 axes x1y2 title 'DTU' ls l0fill lw 1 with needles
ich habe probiert:
#LogDB MQTT2_Solar:diff_hour_Hourlast_Production:offset=-3600*6::$val=$val/1000
#LogDB MQTT2_SolarDTU:diff_hour_Hourlast_Production_DTU:offset=-3600*10::$val=$val/1000
Die Nadeln sind immer noch übereinander.
Wo kann ich nachlesen, wie der Offset genau eingetragen wird, oder hat jemand einen Tipp?
Dankeschön
ZitatWo kann ich nachlesen, wie der Offset genau eingetragen wird, oder hat jemand einen Tipp?
Hier: https://wiki.fhem.de/wiki/LogProxy
LogProxy bereitet Daten, die von anderen Modulen (FileLog oder DbLog) geliefert werden, fuer das SVG Modul vor.
Zitat von: NewbieNew am 04 Mai 2024, 09:23:50Ich bekomme den Offset nicht hin:
Die Nadeln sind immer noch übereinander.
Wo kann ich nachlesen, wie der Offset genau eingetragen wird, oder hat jemand einen Tipp?
Hier mein gplot File, "dblog" ist mein DbLog Device, "logProxy" mein logProxy:
# Created by FHEM/98_SVG.pm, 2024-03-11 20:48:54
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 title 'Stromverbrauch total pro Tag'
set ytics
set y2tics
set grid
set ylabel "kWh"
set y2label ""
#logProxy DbLog:dblog,offset=-3600*8:Stromzaehler_EG:Bezug_heute_kwh_Total::
#logProxy DbLog:dblog,offset=-3600*4:Stromzaehler_1Stock:Bezug_heute_kwh_Total::
#logProxy DbLog:dblog:Stromzaehler_2Stock:Bezug_heute_kwh_Total::
plot "<IN>" using 1:2 axes x1y1 title 'EG' ls l0 lw 1 with needles,\
"<IN>" using 1:2 axes x1y1 title '1Stock' ls l1 lw 1 with needles,\
"<IN>" using 1:2 axes x1y1 title '2Stock' ls l2 lw 1 with needles