diff options
author | Niko Tyni <ntyni@iki.fi> | 2005-10-14 14:49:18 +0200 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2005-10-14 14:49:18 +0200 |
commit | 7f89ec986512196ded2ce2aaa35227a556a31fc5 (patch) | |
tree | 5c28669a0adc78169e1008ce332c93251bbf8b8d /lib/Smokeping.pm | |
parent | 2f5b3b13f36137299dbb240d42db261f07772739 (diff) | |
download | smokeping-7f89ec986512196ded2ce2aaa35227a556a31fc5.tar.gz smokeping-7f89ec986512196ded2ce2aaa35227a556a31fc5.tar.xz |
* (trunk,2.0)/
lib/Smokeping.pm,
CHANGES:
+ include the smallest ping value in the graphs too
Diffstat (limited to 'lib/Smokeping.pm')
-rw-r--r-- | lib/Smokeping.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index e00df44..738bc3c 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -670,17 +670,17 @@ sub findmax ($$) { } sub smokecol ($) { - my $count = ( shift )- 2 ; - return [] unless $count > 0; + my $count = shift; + return [] unless $count > 2; my $half = $count/2; my @items; for (my $i=$count; $i > $half; $i--){ my $color = int(190/$half * ($i-$half))+50; - push @items, "AREA:cp".($i+2)."#".(sprintf("%02x",$color) x 3); + push @items, "AREA:cp".($i)."#".(sprintf("%02x",$color) x 3); }; - for (my $i=int($half); $i >= 0; $i--){ - my $color = int(190/$half * ($half - $i))+64; - push @items, "AREA:cp".($i+2)."#".(sprintf("%02x",$color) x 3); + for (my $i=int($half); $i > 0; $i--){ + my $color = int(190/$half * ($half - $i + 1))+64; + push @items, "AREA:cp".($i)."#".(sprintf("%02x",$color) x 3); }; return \@items; } |