summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@iki.fi>2005-10-14 14:49:18 +0200
committerNiko Tyni <ntyni@iki.fi>2005-10-14 14:49:18 +0200
commit7f89ec986512196ded2ce2aaa35227a556a31fc5 (patch)
tree5c28669a0adc78169e1008ce332c93251bbf8b8d
parent2f5b3b13f36137299dbb240d42db261f07772739 (diff)
downloadsmokeping-7f89ec986512196ded2ce2aaa35227a556a31fc5.tar.gz
smokeping-7f89ec986512196ded2ce2aaa35227a556a31fc5.tar.xz
* (trunk,2.0)/
lib/Smokeping.pm, CHANGES: + include the smallest ping value in the graphs too
-rw-r--r--CHANGES3
-rw-r--r--lib/Smokeping.pm12
2 files changed, 9 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 3cfbd9e..d92c983 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+* include the smallest ping value in the graphs too
+ -- niko, from ChunjingHan <chjhan *cstnet.cn>
+
2005/10/14 -- released version 20051014_trunk
2005/10/13 -- released version 20051013_trunk
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;
}