version 1.48, 2002/02/06 10:24:55
|
version 1.50, 2002/02/27 16:54:58
|
Line 29
|
Line 29
|
# 12/17 12/18 12/19 12/20 12/21 12/27 12/28 12/30 12/31 Matthew |
# 12/17 12/18 12/19 12/20 12/21 12/27 12/28 12/30 12/31 Matthew |
# 01/01/02 Matthew |
# 01/01/02 Matthew |
# 01/02 01/03 01/04 01/07 01/08 01/09 Matthew |
# 01/02 01/03 01/04 01/07 01/08 01/09 Matthew |
# 01/21 02/05 Matthew |
# 01/21 02/05 02/06 Matthew |
|
|
package Apache::lonplot; |
package Apache::lonplot; |
|
|
Line 564 sub start_title {
|
Line 564 sub start_title {
|
my $result=''; |
my $result=''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$title = &Apache::lonxml::get_all_text("/title",$$parser[-1]); |
$title = &Apache::lonxml::get_all_text("/title",$$parser[-1]); |
|
$title =~ s/\n/ /g; |
if (length($title) > $max_str_len) { |
if (length($title) > $max_str_len) { |
$title = substr($title,0,$max_str_len); |
$title = substr($title,0,$max_str_len); |
} |
} |
Line 596 sub start_xlabel {
|
Line 597 sub start_xlabel {
|
my $result=''; |
my $result=''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$xlabel = &Apache::lonxml::get_all_text("/xlabel",$$parser[-1]); |
$xlabel = &Apache::lonxml::get_all_text("/xlabel",$$parser[-1]); |
|
$xlabel =~ s/\n/ /g; |
if (length($xlabel) > $max_str_len) { |
if (length($xlabel) > $max_str_len) { |
$xlabel = substr($xlabel,0,$max_str_len); |
$xlabel = substr($xlabel,0,$max_str_len); |
} |
} |
Line 629 sub start_ylabel {
|
Line 631 sub start_ylabel {
|
my $result=''; |
my $result=''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$ylabel = &Apache::lonxml::get_all_text("/ylabel",$$parser[-1]); |
$ylabel = &Apache::lonxml::get_all_text("/ylabel",$$parser[-1]); |
|
$ylabel =~ s/\n/ /g; |
if (length($ylabel) > $max_str_len) { |
if (length($ylabel) > $max_str_len) { |
$ylabel = substr($ylabel,0,$max_str_len); |
$ylabel = substr($ylabel,0,$max_str_len); |
} |
} |
Line 665 sub start_label {
|
Line 668 sub start_label {
|
&get_attributes(\%label,\%label_defaults,$parstack,$safeeval, |
&get_attributes(\%label,\%label_defaults,$parstack,$safeeval, |
$tagstack->[-1]); |
$tagstack->[-1]); |
my $text = &Apache::lonxml::get_all_text("/label",$$parser[-1]); |
my $text = &Apache::lonxml::get_all_text("/label",$$parser[-1]); |
|
$text =~ s/\n/ /g; |
$text = substr($text,0,$max_str_len) if (length($text) > $max_str_len); |
$text = substr($text,0,$max_str_len) if (length($text) > $max_str_len); |
$label{'text'} = $text; |
$label{'text'} = $text; |
push(@labels,\%label); |
push(@labels,\%label); |
Line 785 sub start_data {
|
Line 789 sub start_data {
|
$datatext = &Apache::run::run('return "'.$datatext.'"', |
$datatext = &Apache::run::run('return "'.$datatext.'"', |
$safeeval,1); |
$safeeval,1); |
} |
} |
$datatext =~ s/\s+/ /g; |
$datatext =~ s/\s+/ /g; |
# Need to do some error checking on the @data array - |
# Need to do some error checking on the @data array - |
# make sure it's all numbers and make sure each array |
# make sure it's all numbers and make sure each array |
# is of the same length. |
# is of the same length. |
Line 1085 sub edit_attributes {
|
Line 1089 sub edit_attributes {
|
sub insert_gnuplot { |
sub insert_gnuplot { |
my $result = ''; |
my $result = ''; |
# plot attributes |
# plot attributes |
$result .= "<plot \n"; |
$result .= "<gnuplot \n"; |
foreach my $attr (keys(%gnuplot_defaults)) { |
foreach my $attr (keys(%gnuplot_defaults)) { |
$result .= " $attr=\"$gnuplot_defaults{$attr}->{'default'}\"\n"; |
$result .= " $attr=\"$gnuplot_defaults{$attr}->{'default'}\"\n"; |
} |
} |
Line 1097 sub insert_gnuplot {
|
Line 1101 sub insert_gnuplot {
|
# $result .= &insert_xlabel(); |
# $result .= &insert_xlabel(); |
# $result .= &insert_ylabel(); |
# $result .= &insert_ylabel(); |
$result .= &insert_curve(); |
$result .= &insert_curve(); |
# close up the <plot> |
# close up the <gnuplot> |
$result .= "</plot>\n"; |
$result .= "</gnuplot>\n"; |
return $result; |
return $result; |
} |
} |
|
|