Author: spadkins
Date: Tue Sep 25 08:48:31 2007
New Revision: 9998
Modified:
p5ee/trunk/App-Widget/lib/App/Widget/Graph.pm
Log:
0000491: Graphs with undefined values should discontinue the line rather than
go to zero
Modified: p5ee/trunk/App-Widget/lib/App/Widget/Graph.pm
==============================================================================
--- p5ee/trunk/App-Widget/lib/App/Widget/Graph.pm (original)
+++ p5ee/trunk/App-Widget/lib/App/Widget/Graph.pm Tue Sep 25 08:48:31 2007
@@ -98,9 +98,7 @@
if ($spec->{y}) {
$y = $spec->{y};
if (ref($y->[0]) eq "ARRAY") {
-
$yn = $y;
-
}
else {
push(@$yn, $y);
@@ -237,14 +235,21 @@
$yn_val = $object->{$column};
if ($format && $format =~ /%/) {
- $yn_val = App::Widget->format($yn_val,
$column_defs->{$column});
- $yn_val =~ s/%//;
+ if ($yn_val ne "") {
+ $yn_val = App::Widget->format($yn_val,
$column_defs->{$column});
+ $yn_val =~ s/%//;
+ }
}
elsif ($format && $format =~ /\s+\((?:\/)?\d+\)/) {
- if ($yn_val ne "") {
+ if ($yn_val ne "") {
$yn_val = App::Widget->format($yn_val,
$column_defs->{$column});
}
}
+
+ # A special constant called NoValue, which is equal to
1.7E+308.
+ # When ChartDirector sees that a data point is NoValue, it
will jump over that point
+ $yn_val = 1.7e+308 if ($yn_val eq "");
+
$yn[$j][$i] = $yn_val;
}
}
@@ -310,14 +315,21 @@
$yn_val = $object->{$column};
if ($format && $format =~ /%/) {
- $yn_val = App::Widget->format($yn_val,
$column_defs->{$column});
- $yn_val =~ s/%//;
+ if ($yn_val ne "") {
+ $yn_val = App::Widget->format($yn_val,
$column_defs->{$column});
+ $yn_val =~ s/%//;
+ }
}
elsif ($format && $format =~ /\s+\((?:\/)?\d+\)/) {
- if ($yn_val ne "") {
+ if ($yn_val ne "") {
$yn_val = App::Widget->format($yn_val,
$column_defs->{$column});
}
}
+
+ # A special constant called NoValue, which is equal to 1.7E+308.
+ # When ChartDirector sees that a data point is NoValue, it will
jump over that point
+ $yn_val = 1.7e+308 if ($yn_val eq "");
+
$yn[$y_idx{$y_value}][$x_idx{$x_value}] = $yn_val;
}