[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 24 Oct 2003 13:35:37 -0000


matthew		Fri Oct 24 09:35:37 2003 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  Changed name of DrawGraph to DrawBarGraph.
  Added default color settings.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.133 loncom/interface/loncommon.pm:1.134
--- loncom/interface/loncommon.pm:1.133	Thu Oct 23 17:01:54 2003
+++ loncom/interface/loncommon.pm	Fri Oct 24 09:35:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.133 2003/10/23 21:01:54 albertel Exp $
+# $Id: loncommon.pm,v 1.134 2003/10/24 13:35:37 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2677,16 +2677,22 @@
 
 =pod
 
-=item DrawGraph
+=item DrawBarGraph
 
-Returns a link to cgi-bin/graph
 
 =cut
 
 ############################################################
 ############################################################
-sub DrawGraph {
+sub DrawBarGraph {
     my ($Title,$xlabel,$ylabel,$Max,$colors,@Values)=@_;
+    #
+    if (! defined($colors)) {
+        $colors = ['#33ff00', 
+                  '#0033cc', '#990000', '#aaaa66', '#663399', '#ff9933',
+                  '#66ccff', '#ff9999', '#cccc33', '#660000', '#33cc66',
+                  ]; 
+    }
     #
     my $identifier = time.'_'.int(rand(1000));
     if (! @Values || ref($Values[0]) ne 'ARRAY') {