[LON-CAPA-cvs] cvs: loncom /cgi graph.png

minaeibi lon-capa-cvs@mail.lon-capa.org
Sat, 11 Jan 2003 06:28:19 -0000


minaeibi		Sat Jan 11 01:28:19 2003 EDT

  Modified files:              
    /loncom/cgi	graph.png 
  Log:
  This version trierd to fix bug #1020 and 1052.
  The lonpercentage.pm graph works better and meaningful.
  The width between x-labels are 5 among 100 entries.
  The whole width of garph is 800 pixel.
  The bin between y_labels iS also 5. 
  
  
Index: loncom/cgi/graph.png
diff -u loncom/cgi/graph.png:1.17 loncom/cgi/graph.png:1.18
--- loncom/cgi/graph.png:1.17	Tue Jan  7 22:31:54 2003
+++ loncom/cgi/graph.png	Sat Jan 11 01:28:19 2003
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# $Id: graph.png,v 1.17 2003/01/08 03:31:54 minaeibi Exp $
+# $Id: graph.png,v 1.18 2003/01/11 06:28:19 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -46,12 +46,15 @@
 
 my @data11=split(/\,/,$data1);
 my @data12=split(/\,/,$data2);
+my $skip_x = 1;
+my $bar_space=10;
 
 my @xlabels;
 
 if ($xlab=~/^Percentage$/){
     for (my $nIdx=0; $nIdx<$PNo; $nIdx++ ) {
-        $xlabels[$nIdx]=$data11[$nIdx];
+#        $xlabels[$nIdx]=$data11[$nIdx];
+        $xlabels[$nIdx]=$nIdx;
     }
     @data11=();
     @data11=split(/\,/,$data2);
@@ -71,8 +74,11 @@
     $Range1=270;
     $Range2=200;
 } elsif ($xlab=~/^Percentage$/){
-    $Range1=250+20*$PNo; 
-    $Range2=200; 
+    $Range1=800;#*$PNo; 
+    $Range2=200;
+    $skip_x=5;
+    $bar_space=1;
+    $xlab='Percentage_of_Correct_Problems';
 } else {
     $Range1=450;
     $Range2=200;
@@ -90,11 +96,12 @@
     title           => $Titr,
     y_max_value     => $Max,
 #    y_tick_number   => $ytic,
-    y_label_skip    => 1,   
+    y_label_skip    => 5,
+    x_label_skip    => $skip_x,   
 
     dclrs           => [ qw( lgreen dgreen lyellow lpurple cyan lorange)],
     
-    bar_spacing     => 10,
+    bar_spacing     => $bar_space,
     cumulate        => 2,
     zero_axis        => 1,