[Bps-public-commit] r11437 - RT-Extension-Reports/html/Reports/Elements

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Apr 3 09:35:41 EDT 2008


Author: sunnavy
Date: Thu Apr  3 09:33:57 2008
New Revision: 11437

Modified:
   RT-Extension-Reports/html/Reports/Elements/ShowResults

Log:
replace GD::Graph to WebChart

Modified: RT-Extension-Reports/html/Reports/Elements/ShowResults
==============================================================================
--- RT-Extension-Reports/html/Reports/Elements/ShowResults	(original)
+++ RT-Extension-Reports/html/Reports/Elements/ShowResults	Thu Apr  3 09:33:57 2008
@@ -99,12 +99,13 @@
             }
         }
 
-        require GD::Graph::bars;
-        my $graph = GD::Graph::bars->new( 800, 600 );
-        $graph->set_legend(@$Headers[1 .. $#$Headers]);
-        my $gd = $graph->plot(\@data) or die $graph->error;
-        $r->content_type( 'image/png' );
-        $m->out( $gd->png );
+        require WebChart;
+        my $wc = WebChart->new( width => 800, height => 600 );
+        my ( $seg, $file ) = $wc->render( data => \@data, type => 'bars' );
+        $r->content_type('image/png');
+        open my $fh, '<', $file or die "can't open $file";
+        local $/;
+        $m->out( <$fh> );
     }
 }
 else {



More information about the Bps-public-commit mailing list