Diff for /loncom/interface/loncommon.pm between versions 1.177 and 1.178

version 1.177, 2004/01/29 19:29:53 version 1.178, 2004/02/02 19:32:11
Line 2992  If $Max is < any data point, the graph w Line 2992  If $Max is < any data point, the graph w
 =item $colors: array ref holding the colors to be used for the data sets when  =item $colors: array ref holding the colors to be used for the data sets when
 they are plotted.  If undefined, default values will be used.  they are plotted.  If undefined, default values will be used.
   
   =item $labels: array ref holding the labels to use on the x-axis for the bars.
   
 =item @Values: An array of array references.  Each array reference holds data  =item @Values: An array of array references.  Each array reference holds data
 to be plotted in a stacked bar chart.  to be plotted in a stacked bar chart.
   
Line 3007  information for the plot. Line 3009  information for the plot.
 ############################################################  ############################################################
 ############################################################  ############################################################
 sub DrawBarGraph {  sub DrawBarGraph {
     my ($Title,$xlabel,$ylabel,$Max,$colors,@Values)=@_;      my ($Title,$xlabel,$ylabel,$Max,$colors,$labels,@Values)=@_;
     #      #
     if (! defined($colors)) {      if (! defined($colors)) {
         $colors = ['#33ff00',           $colors = ['#33ff00', 
Line 3050  sub DrawBarGraph { Line 3052  sub DrawBarGraph {
     }      }
     #      #
     my @Labels;      my @Labels;
     for (my $i=0;$i<@{$Values[0]};$i++) {      if (defined($labels)) {
         push (@Labels,$i+1);          @Labels = @$labels;
       } else {
           for (my $i=0;$i<@{$Values[0]};$i++) {
               push (@Labels,$i+1);
           }
     }      }
     #      #
     $Max = 1 if ($Max < 1);      $Max = 1 if ($Max < 1);

Removed from v.1.177  
changed lines
  Added in v.1.178


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>