From 7f89ec986512196ded2ce2aaa35227a556a31fc5 Mon Sep 17 00:00:00 2001 From: Niko Tyni Date: Fri, 14 Oct 2005 12:49:18 +0000 Subject: * (trunk,2.0)/ lib/Smokeping.pm, CHANGES: + include the smallest ping value in the graphs too --- CHANGES | 3 +++ lib/Smokeping.pm | 12 ++++++------ 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 + 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; } -- cgit v1.2.3-24-g4f1b