--- db2gantt.cgi 2002/09/13 13:55:27 1.6 +++ db2gantt.cgi 2002/09/13 14:03:47 1.8 @@ -120,12 +120,14 @@ my $size = int($l / ($len_t / $width)); if ($size < $min_l) { + $fix_d += ($min_l - $size); + print STDERR "fix_d: $fix_d\n" if ($debug); $size = $min_l; - $fix_d += $min_l; } if ($fix_d && $size > $fix_d+$min_l) { $size -= $fix_d; $fix_d = 0; + print STDERR "fix_d: $fix_d\n" if ($debug); } print STDERR "bar[$status] len:$l s scale:",($len_t/$width)," size:$size px
alt:$alt\n" if ($debug); @@ -133,7 +135,11 @@ my $html = "url(-relative=>1)."?pic="; if ($status) { - $html .= $cols{$status}; + if ($cols{$status}) { + $html .= $cols{$status}; + } else { + $html .= "0,0,0"; # unknown status, black + } $count{$status}++; } else { # $html .= '240,240,240'; @@ -251,9 +257,11 @@ print "\n"; foreach my $status (keys %count) { #foreach my $status (keys %cols) { - print "\n" if ($status ne ""); - # -1 in line above is a cludge to display correct number on - # occurences on graph and without one on legend! + print "\n" if ($status ne ""); + # *1 in line above is a cludge to display correct number on + # occurences on graph and without one on legend! If you remove * op + # it will first evaluate bar sub (thus increasing number by one) and + # then display number (wrongly). } -print "
status#color
$status",$count{$status}-1,"",bar($count{$status},$status),"
$status",$count{$status}*1,"",bar($count{$status},$status),"
\n"; +print "\n

Reload url(-relative=>1),"\">current.

";