Subject: | problem drawing mixed charts with area chart that contains undefined values |
(Ooops. I'll try again.)
If you create a "mixed" chart, and use an "area" chart for one of the elements, *and* the dataset you provide contains an undefined value, the area-chart creation fails, and GD::Graph reverts to a line-chart.
This is because the construction of the "hotspots" isn't checking for an undefined value. A simple patch is supplied.
By the way, the error message that results is pretty misleading -- it claims "Set <n>, unknown type area, assuming line". But the type is fine; it's that the call to GD::Graph::area::draw_data_set() is failing and triggering the eval() to fail.
--- /tmp/area.pm 2002-06-18 17:59:00.000000000 -0700
+++ /Library/Perl/GD/Graph/area.pm 2002-06-18 17:59:02.000000000 -0700
@@ -56,6 +56,7 @@
# Hotspot stuff
# XXX needs fixing
+ next unless defined $self->{_hotspots}->[$ds]->[$i];
if ($i == 0)
{
$self->{_hotspots}->[$ds]->[$i] = ["poly",