mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 10:46:53 +00:00
Autorange bug if specifying min/max values
git-svn-id: https://svn.fhem.de/fhem/trunk@607 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4280910524
commit
b4c531d937
@ -239,6 +239,14 @@ SVG_render($$$$$$)
|
||||
|
||||
# Round values, compute a nice step
|
||||
next if(!defined($hmax{$axis}));
|
||||
|
||||
# yrange handling
|
||||
my $yr = ($axis eq "x1y1" ? "yrange" : "y2range");
|
||||
if($conf{$yr} && $conf{$yr} =~ /\[(.*):(.*)\]/) {
|
||||
$hmin{$axis} = $1 if($1 ne "");
|
||||
$hmax{$axis} = $2 if($2 ne "");
|
||||
}
|
||||
|
||||
my $dh = $hmax{$axis} - $hmin{$axis};
|
||||
my ($step, $mi, $ma) = (1, 1, 1);
|
||||
my @limit = (1,2,5,10,20,50,100,200,500,1000,2000,5000,10000,
|
||||
@ -257,13 +265,6 @@ SVG_render($$$$$$)
|
||||
$step = $l/10;
|
||||
last;
|
||||
}
|
||||
|
||||
# yrange handling
|
||||
my $yr = ($axis eq "x1y1" ? "yrange" : "y2range");
|
||||
if($conf{$yr} && $conf{$yr} =~ /\[(.*):(.*)\]/) {
|
||||
$mi = $1 if($1 ne "");
|
||||
$ma = $2 if($2 ne "");
|
||||
}
|
||||
$hmax{$axis} = $ma;
|
||||
$hmin{$axis} = $mi;
|
||||
|
||||
@ -301,7 +302,8 @@ SVG_render($$$$$$)
|
||||
}
|
||||
$off2 += $th/4;
|
||||
my $align = ($axis eq "x1y1" ? " text-anchor=\"end\"" : "");
|
||||
pO "<text x=\"$off1\" y=\"$off2\" class=\"ylabel\"$align>$i</text>";
|
||||
my $txt = sprintf("%g", $i);
|
||||
pO "<text x=\"$off1\" y=\"$off2\" class=\"ylabel\"$align>$txt</text>";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user