--- loncom/cgi/graph.png 2003/10/27 21:21:08 1.29 +++ loncom/cgi/graph.png 2003/10/29 14:47:43 1.30 @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# $Id: graph.png,v 1.29 2003/10/27 21:21:08 matthew Exp $ +# $Id: graph.png,v 1.30 2003/10/29 14:47:43 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -143,7 +143,7 @@ my %GraphSettings = ( $GraphSettings{'x_label_skip'} = &get_env('xskip',1); $GraphSettings{'x_tick_offset'} = &get_env('x_tick_offset',0); -$GraphSettings{'y_max_value'} = &get_env('Max',undef); +$GraphSettings{'y_max_value'} = &get_env('Max',1); my $MyGraph; if ($PlotType eq 'bar') { @@ -168,6 +168,13 @@ if ($PlotType eq 'bar') { $GraphSettings{'x_label_skip'} = $skip_x; $GraphSettings{'x_tick_offset'} = $x_tick_offset; $GraphSettings{'zero_axis'} = 1; + if (&get_env('two_axes',0)) { + $GraphSettings{'two_axes'} = 1; + $GraphSettings{'y1_max_value'} = &get_env('y1_max_value',0); + $GraphSettings{'y1_min_value'} = &get_env('y1_min_value',1); + $GraphSettings{'y2_max_value'} = &get_env('y2_max_value',1); + $GraphSettings{'y2_min_value'} = &get_env('y2_min_value',1); + } } # # Pick up miscellanious values passed in by the user @@ -202,9 +209,11 @@ if (! $MyGraph->set(%GraphSettings)) { my $plot = $MyGraph->plot(\@Data); if (! defined($plot)) { my $error = 'Unable to plot the data provided.'; - $error .= '
'.join(',',@{$Data[0]}).'
'; - $error .= '
'.join(',',@{$Data[1]}).'
'; - $error .= '
'.join(',',@{$Data[2]}).'
'; +# Debugging code: +# $error .= '
'.join(',',@{$Data[0]}).'
'; +# $error .= '
'.join(',',@{$Data[1]}).'
'; +# $error .= '
'.join(',',@{$Data[2]}).'
' if (ref($Data[2])); +# $error .= '
'.join(',',@{$Data[3]}).'
' if (ref($Data[3])); print &error($error); exit; }