mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
98_SVG.pm/92_FileLog.pm: fix $data{sumX} for multi-source plot (Forum #80966)
git-svn-id: https://svn.fhem.de/fhem/trunk@15597 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e2b290c02d
commit
69433f2adc
@ -913,6 +913,7 @@ RESCAN:
|
||||
}
|
||||
|
||||
my $j = $i+1;
|
||||
$j += $data{svgOffset} if($data{svgOffset});
|
||||
$data{"min$j"} = $min[$i];
|
||||
$data{"max$j"} = $max[$i];
|
||||
$data{"avg$j"} = $cnt[$i] ? sprintf("%0.1f", $sum[$i]/$cnt[$i]) : 0;
|
||||
|
@ -753,7 +753,7 @@ SVG_WriteGplot($)
|
||||
# - {src}{X}: hash (X is an order element), consisting of
|
||||
# {arg}: plot arguments for one dev, space separated
|
||||
# {idx}: number of lines requested from the same source
|
||||
# {num}: number or this src in the order array
|
||||
# {num}: number of this src in the order array
|
||||
# - {rev}{orderIdx}{localIdx} = N: reverse lookup of the plot argument index,
|
||||
# using {src}{X}{num} as orderIdx and {src}{X}{idx} as localIdx
|
||||
sub
|
||||
@ -1211,6 +1211,7 @@ SVG_getData($$$$$)
|
||||
my @keys = ("min","mindate","max","maxdate","currval","currdate",
|
||||
"firstval","firstdate","avg","cnt","lastraw");
|
||||
|
||||
$data{svgOffset} = 0;
|
||||
foreach my $src (@{$srcDesc->{order}}) {
|
||||
my $s = $srcDesc->{src}{$src};
|
||||
my $fname = ($src eq $defs{$d}{LOGDEVICE} ? $defs{$d}{LOGFILE} : "CURRENT");
|
||||
@ -1229,9 +1230,10 @@ SVG_getData($$$$$)
|
||||
}
|
||||
push @vals, \%h;
|
||||
}
|
||||
|
||||
$data{svgOffset} += ($s->{idx}+1);
|
||||
}
|
||||
}
|
||||
delete($data{svgOffset});
|
||||
|
||||
# Reorder the $data{maxX} stuff
|
||||
my ($min, $max) = (999999, -999999);
|
||||
|
Loading…
Reference in New Issue
Block a user