diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 209463691..cce1b9b86 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -1554,9 +1554,9 @@ FW_select($$$$$@) my $s = ""; diff --git a/fhem/FHEM/98_weblink.pm b/fhem/FHEM/98_weblink.pm index 5820072ae..fb7a42e55 100755 --- a/fhem/FHEM/98_weblink.pm +++ b/fhem/FHEM/98_weblink.pm @@ -273,6 +273,14 @@ wl_getRegFromFile($) close(FH); } +sub +wl_addTics($$) +{ + my ($in, $p) = @_; + return if(!$in || $in !~ m/^\((.*)\)$/); + map { $p->{"\"$2\""}=1 if(m/^ *([^ ]+) ([^ ]+) */); } split(",",$1); +} + ############################ # gnuplot file "editor" sub @@ -323,13 +331,19 @@ wl_PEdit($$$$) my ($colnums, $colregs, $coldata) = wl_getRegFromFile($file); $colnums = join(",", 3..$colnums); - my $max = @{$conf{lAxis}}+1; + + my %tickh; + wl_addTics($conf{ytics}, \%tickh); + wl_addTics($conf{y2tics}, \%tickh); + $colnums = join(",", sort keys %tickh).",$colnums" if(%tickh); + + my $max = @{$conf{lType}}+1; $max = 8 if($max > 8); - $max = 1 if(!$conf{lTitle}[0]); my $r = 0; for($r=0; $r < $max; $r++) { $ret .= ""; - $ret .= wl_txt("title_${r}", "", $conf{lTitle}[$r], 12); + $ret .= wl_txt("title_${r}", "", !$conf{lTitle}[$r]&&$r<($max-1) ? + "notitle" : $conf{lTitle}[$r], 12); $ret .= ""; my @f = split(":", ($flog->[$r] ? $flog->[$r] : ":::"), 4); $ret .= wl_sel("cl_${r}", $colnums, $f[0]); @@ -413,7 +427,8 @@ weblink_WriteGplot($) $FW_webArgs{"fn_$i"} ."\n"; push @plot, "\"\" using 1:2 axes ". ($FW_webArgs{"axes_$i"} eq "right" ? "x1y2" : "x1y1"). - " title '".$FW_webArgs{"title_$i"} ."'". + ($FW_webArgs{"title_$i"} eq "notitle" ? " notitle" : + " title '".$FW_webArgs{"title_$i"} ."'"). " ls " .$FW_webArgs{"style_$i"} . " lw " .$FW_webArgs{"width_$i"} . " with " .$FW_webArgs{"type_$i"}; @@ -468,7 +483,7 @@ weblink_WriteGplot($) file, even if its name changes regularly (and not the one you originally specified).
  • For cmdList <argument> consist of a list of space separated icon:label:cmd triples.
  • - + @@ -491,15 +506,14 @@ weblink_WriteGplot($)
  • fixedrange
  • plotsize
  • plotmode
  • @@ -511,9 +525,9 @@ weblink_WriteGplot($) expression, so you have access e.g. to the Value functions.

    If the plotmode is gnuplot-scroll or SVG, you can also use the min, max, - avg, cnt, sum, currval (last value) and currdate (last date) values of the - individual curves, by accessing the corresponding values from the data - hash, see the example below:
    + avg, cnt, sum, currval (last value) and currdate (last date) values of + the individual curves, by accessing the corresponding values from the + data hash, see the example below:
    -
    + + Plot-Editor specialities + +
    =end html