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

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


matthew		Fri Oct 24 09:36:16 2003 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemstatistics.pm 
  Log:
  Update to use &Apache::loncommon::DrawBarGraph().
  Removed DrawGraph routine.
  
  
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.59 loncom/interface/statistics/lonproblemstatistics.pm:1.60
--- loncom/interface/statistics/lonproblemstatistics.pm:1.59	Mon Sep 29 12:20:18 2003
+++ loncom/interface/statistics/lonproblemstatistics.pm	Fri Oct 24 09:36:16 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemstatistics.pm,v 1.59 2003/09/29 16:20:18 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.60 2003/10/24 13:36:16 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -751,45 +751,17 @@
         }
     }
     
-    $r->print("<p>".&DrawGraph(\@Data,$title,'Problem Number',$yaxis,
-                               $Max)."</p>\n");
+    $r->print("<p>".&Apache::loncommon::DrawBarGraph($title,
+                                                     'Problem Number',
+                                                     $yaxis,
+                                                     $Max,
+                                                     undef,
+                                                     \@Data)."</p>\n");
     #
     # Print out the data
     $ENV{'form.sortby'} = 'Contents';
 #    &output_html_ungrouped($r);
     return;
-}
-
-###############################################
-###############################################
-
-=pod 
-
-=item &DrawGraph()
-
-=cut
-
-###############################################
-###############################################
-sub DrawGraph {
-    my ($values,$title,$xaxis,$yaxis,$Max)=@_;
-    $title = '' if (! defined($title));
-    $xaxis = '' if (! defined($xaxis));
-    $yaxis = '' if (! defined($yaxis));
-    $title = &Apache::lonnet::escape($title);
-    $xaxis = &Apache::lonnet::escape($xaxis);
-    $yaxis = &Apache::lonnet::escape($yaxis);
-    #
-    my $sendValues = join(',', @$values);
-    my $sendCount = scalar(@$values);
-    $Max =1 if ($Max < 1);
-    if ( int($Max) < $Max ) {
-        $Max++;
-        $Max = int($Max);
-    }
-    my @GData = ($title,$xaxis,$yaxis,$Max,$sendCount,$sendValues);
-    return '<IMG src="/cgi-bin/graph.png?'.
-        (join('&', @GData)).'" border="1" />';
 }
 
 sub get_statistics {