--- loncom/xml/lonplot.pm 2002/01/10 16:29:54 1.37
+++ loncom/xml/lonplot.pm 2002/01/15 16:21:39 1.40
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Dynamic plot
#
-# $Id: lonplot.pm,v 1.37 2002/01/10 16:29:54 matthew Exp $
+# $Id: lonplot.pm,v 1.40 2002/01/15 16:21:39 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -126,25 +126,29 @@ my %plot_defaults =
default => 200,
test => $int_test,
description => 'height of image (pixels)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
width => {
default => 200,
test => $int_test,
description => 'width of image (pixels)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
bgcolor => {
default => 'xffffff',
test => $color_test,
description => 'background color of image (xffffff)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
fgcolor => {
default => 'x000000',
test => $color_test,
description => 'foreground color of image (x000000)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
transparent => {
default => 'off',
@@ -186,7 +190,8 @@ my %key_defaults =
default => '',
test => $words_test,
description => 'Title of key',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '40'
},
box => {
default => 'off',
@@ -210,13 +215,15 @@ my %label_defaults =
default => 0,
test => $real_test,
description => 'x position of label (graph coordinates)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
ypos => {
default => 0,
test => $real_test,
description => 'y position of label (graph coordinates)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
justify => {
default => 'left',
@@ -233,31 +240,36 @@ my %axis_defaults =
default => 'x000000',
test => $color_test,
description => 'color of axes (x000000)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
xmin => {
default => '-10.0',
test => $real_test,
description => 'minimum x-value shown in plot',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
xmax => {
default => ' 10.0',
test => $real_test,
description => 'maximum x-value shown in plot',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
ymin => {
default => '-10.0',
test => $real_test,
description => 'minimum y-value shown in plot',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
ymax => {
default => ' 10.0',
test => $real_test,
description => 'maximum y-value shown in plot',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
}
);
@@ -267,24 +279,22 @@ my %curve_defaults =
default => 'x000000',
test => $color_test,
description => 'color of curve (x000000)',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '10'
},
name => {
default => '',
test => $words_test,
description => 'name of curve to appear in key',
- edit_type => 'entry'
+ edit_type => 'entry',
+ size => '20'
},
linestyle => {
default => 'lines',
test => $linestyle_test,
description => 'Line style',
edit_type => 'choice',
- choices => ['lines','linespoints','dots','points','steps',
- 'fsteps','histeps','errorbars','xerrorbars',
- 'yerrorbars','xyerrorbars','boxes','boxerrorbars',
- 'boxxyerrorbars','financebars','candlesticks',
- 'vector']
+ choices => [keys(%linestyles)]
}
);
@@ -320,7 +330,6 @@ sub start_plot {
($token,$parstack,$safeeval,keys(%plot_defaults));
if ($constructtag) {
$result = &Apache::edit::rebuild_tag($token);
-# $result.= &Apache::edit::handle_insert();
}
}
return $result;
@@ -341,9 +350,7 @@ sub end_plot {
my $filename = $ENV{'user.name'}.'_'.$ENV{'user.domain'}.
'_'.time.'_'.$$.int(rand(1000)).'_plot.data';
## Write the plot description to the file
- my $fh=Apache::File->new(">$tmpdir$filename");
- print $fh &write_gnuplot_file();
- close($fh);
+ &write_gnuplot_file($tmpdir,$filename);
## return image tag for the plot
$result .= <<"ENDIMAGE";