[Jifty-commit] r3758 - in jifty/trunk: . lib/Jifty/Plugin/Chart/Renderer

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Aug 1 02:49:42 EDT 2007


Author: trs
Date: Wed Aug  1 02:49:40 2007
New Revision: 3758

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Plugin/Chart/Dispatcher.pm
   jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm

Log:
 r25776 at zot:  tom | 2007-08-01 02:49:29 -0400
 - Uncomment neccessary require
 - Make sure to handle undefined stuff


Modified: jifty/trunk/lib/Jifty/Plugin/Chart/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/Dispatcher.pm	Wed Aug  1 02:49:40 2007
@@ -64,7 +64,7 @@
     my $class = 'GD::Graph::' . $args->{type};
 
     # Load that class or die if it does not exist
-    #$class->require;
+    $class->require;
 
     # Remember the class name for the view
     $args->{class} = $class;

Modified: jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm	Wed Aug  1 02:49:40 2007
@@ -79,13 +79,15 @@
     my $labels = shift @{ $args->{data} };
 
     for ( my $i = 0; $i < @$labels; $i++ ) {
-        push @{$args->{options}{xTicks}}, { v => $i, label => $labels->[$i] };
+        push @{$args->{options}{xTicks}}, { v => $i, label => $labels->[$i] }
+            if defined $labels->[$i];
     }
     
     for my $dataset ( @{ $args->{data} } ) {
         my @ds;
         for ( my $i = 0; $i < @$dataset; $i++ ) {
-            push @ds, [ $i, $dataset->[$i] ];
+            # PlotKit can't deal with undefined values
+            push @ds, [ $i, defined $dataset->[$i] ? $dataset->[$i] : '0' ];
         }
         push @data, \@ds;
     }
@@ -103,7 +105,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007 Boomer Consulting, Inc.
+Copyright 2007 Best Practical Solutions, LLC
 
 This is free software and may be modified and distributed under the same terms as Perl itself.
 


More information about the Jifty-commit mailing list