summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}