120 |
|
|
121 |
my $size = int($l / ($len_t / $width)); |
my $size = int($l / ($len_t / $width)); |
122 |
if ($size < $min_l) { |
if ($size < $min_l) { |
123 |
|
$fix_d += ($min_l - $size); |
124 |
|
print STDERR "fix_d: $fix_d\n" if ($debug); |
125 |
$size = $min_l; |
$size = $min_l; |
|
$fix_d += $min_l; |
|
126 |
} |
} |
127 |
if ($fix_d && $size > $fix_d+$min_l) { |
if ($fix_d && $size > $fix_d+$min_l) { |
128 |
$size -= $fix_d; |
$size -= $fix_d; |
129 |
$fix_d = 0; |
$fix_d = 0; |
130 |
|
print STDERR "fix_d: $fix_d\n" if ($debug); |
131 |
} |
} |
132 |
|
|
133 |
print STDERR "bar[$status] len:$l s scale:",($len_t/$width)," size:$size px<br> alt:$alt\n" if ($debug); |
print STDERR "bar[$status] len:$l s scale:",($len_t/$width)," size:$size px<br> alt:$alt\n" if ($debug); |
135 |
my $html = "<img src=\"".$q->url(-relative=>1)."?pic="; |
my $html = "<img src=\"".$q->url(-relative=>1)."?pic="; |
136 |
|
|
137 |
if ($status) { |
if ($status) { |
138 |
$html .= $cols{$status}; |
if ($cols{$status}) { |
139 |
|
$html .= $cols{$status}; |
140 |
|
} else { |
141 |
|
$html .= "0,0,0"; # unknown status, black |
142 |
|
} |
143 |
$count{$status}++; |
$count{$status}++; |
144 |
} else { |
} else { |
145 |
# $html .= '240,240,240'; |
# $html .= '240,240,240'; |
257 |
print "<table border=0><tr bgcolor=#e0e0e0><th>status</th><th>#</th><th>color</th></tr>\n"; |
print "<table border=0><tr bgcolor=#e0e0e0><th>status</th><th>#</th><th>color</th></tr>\n"; |
258 |
foreach my $status (keys %count) { |
foreach my $status (keys %count) { |
259 |
#foreach my $status (keys %cols) { |
#foreach my $status (keys %cols) { |
260 |
print "<tr bgcolor=#e0e0e0><td><small>$status</small></td><td><small>",$count{$status}-1,"</small></td><td>",bar($count{$status},$status),"</td></tr>\n" if ($status ne ""); |
print "<tr bgcolor=#e0e0e0><td><small>$status</small></td><td><small>",$count{$status}*1,"</small></td><td>",bar($count{$status},$status),"</td></tr>\n" if ($status ne ""); |
261 |
# -1 in line above is a cludge to display correct number on |
# *1 in line above is a cludge to display correct number on |
262 |
# occurences on graph and without one on legend! |
# occurences on graph and without one on legend! If you remove * op |
263 |
|
# it will first evaluate bar sub (thus increasing number by one) and |
264 |
|
# then display number (wrongly). |
265 |
} |
} |
266 |
print "</table>\n</body></html>"; |
print "</table>\n<p>Reload <a href=\"",$q->url(-relative=>1),"\">current</a>.</p></body></html>"; |
267 |
|
|