diff --git a/fhem/FHEM/98_DOIF.pm b/fhem/FHEM/98_DOIF.pm index 6d113f3c1..0f5b7a5db 100644 --- a/fhem/FHEM/98_DOIF.pm +++ b/fhem/FHEM/98_DOIF.pm @@ -4548,21 +4548,22 @@ sub card $topVal=($maxValPlot > 0 ? $maxValPlot : 0); $bottomVal=($minValPlot < 0 ? $minValPlot : 0); ($nullColor)=get_color(0,$min,$max,$minColor,$maxColor,$func); - $nullProp=int ($maxValPlot/($maxValPlot-$minValPlot)*10)/10 if ($maxValPlot != $minValPlot); - $topOpacity=0.3; - $bottomOpacity=0.3; - $nullOpacity=0.05; + ##$nullProp=int ($maxValPlot/($maxValPlot-$minValPlot)*10)/10 if ($maxValPlot != $minValPlot); + $nullProp=int ($topVal/($topVal-$bottomVal)*100)/100 if ($bottomVal<0 and $topVal>0); + $topOpacity=($topVal==0 ? 0 : 0.25); + $bottomOpacity=($bottomVal==0 ? 0: 0.25); + $nullOpacity=0.0; } elsif ($max <= 0) { $xpos=0; $topVal=$max; - $topOpacity=0.05; - $bottomOpacity=0.3; + $topOpacity=0.0; + $bottomOpacity=0.25; $bottomVal=$minValPlot; } else { $xpos=50; $topVal=$maxValPlot; - $topOpacity=0.3; - $bottomOpacity=0.05; + $topOpacity=0.25; + $bottomOpacity=0.0; $bottomVal=$min; } @@ -4570,27 +4571,22 @@ sub card my ($topValColor)=get_color($topVal,$min,$max,$minColor,$maxColor,$func); my ($bottomValColor)=get_color($bottomVal,$min,$max,$minColor,$maxColor,$func); - my ($color75)=get_color((($topVal-$bottomVal)*0.75+$bottomVal),$min,$max,$minColor,$maxColor,$func); - my ($color50)=get_color((($topVal-$bottomVal)*0.5+$bottomVal),$min,$max,$minColor,$maxColor,$func); - my ($color25)=get_color((($topVal-$bottomVal)*0.25+$bottomVal),$min,$max,$minColor,$maxColor,$func); - $out.= sprintf ('',$bwidth,$bheight,$svg_width,$svg_height,$svg_width,$svg_height); $out.= ''; $out.= ''; + $out.= sprintf('',$topValColor,$bottomValColor,(defined $lr ? $lr:0)); - $out.= sprintf('',$topVal,$bottomVal,(defined $lr ? $lr:0)); - $out.= sprintf('',color ($topValColor,$lr)); - $out.= sprintf('',color ($color75,$lr)); - $out.= sprintf('',color ($color50,$lr)); - $out.= sprintf('',color ($color25,$lr)); - $out.= sprintf('',color($bottomValColor,$lr)); - $out.= sprintf('',$topVal,$bottomVal,(defined $lr ? $lr:0)); + for (my $i=0; $i<=1;$i+=0.10) { + my ($color)=get_color(($topVal-$bottomVal)*(1-$i)+$bottomVal,$min,$max,$minColor,$maxColor,$func); + $out.= sprintf('',$i,color($color,$lr)); + } + $out.= ''; + $out.= sprintf('',$topValColor,$bottomValColor,(defined $lr ? $lr:0)); $out.= sprintf('',color($topValColor,$lr),$topOpacity); $out.= sprintf('',$nullProp,color($nullColor,$lr),$nullOpacity) if (defined $nullProp); $out.= sprintf('',color($bottomValColor,$lr),$bottomOpacity); $out.= ''; - $out.= ''; $out.= sprintf('',$bwidth-2,$bheight); if (defined $header) { @@ -4625,6 +4621,7 @@ sub card $points.="$i,".(50-int((${$a}[$i]*$m+$n)*10)/10)." "; } } + $out.= sprintf('',$xpos,$xpos); $out.=''; for (my $i=0;$i<=4;$i++) { @@ -4633,9 +4630,9 @@ sub card $out.=sprintf('',$x,$xpos+1.5,$x,$xpos-1.5); $out.=sprintf('',$y,$y); } - $out.=sprintf('',$xpos,$topVal,$bottomVal,(defined $lr ? $lr:0),$topVal,$bottomVal,(defined $lr ? $lr:0)); + $out.= sprintf('" style="fill:url(#gradplotLight_%s_%s_%s);stroke:url(#gradplot_%s_%s_%s);stroke-width:0.5" />',$topValColor,$bottomValColor,(defined $lr ? $lr:0),$topValColor,$bottomValColor,(defined $lr ? $lr:0)); $out.=sprintf('',$maxValSlot,(50-int((${$a}[$maxValSlot]*$m+$n)*10)/10),color($maxValColor,$ln)) if (defined $maxVal and $maxValSlot != 59);