/[omni_gantt]/db2gantt.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /db2gantt.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by dpavlin, Fri Sep 13 13:55:27 2002 UTC revision 1.8 by dpavlin, Fri Sep 13 14:03:47 2002 UTC
# Line 120  sub bar { Line 120  sub bar {
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);
# Line 133  sub bar { Line 135  sub bar {
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';
# Line 251  print "<hr>\nColors for statuses and usa Line 257  print "<hr>\nColors for statuses and usa
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    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.26