Need help with Chart::OFC
am 05.01.2008 04:04:38 von ronThis is Debian, with the usual suspects:
Apache/2.2.6 (Unix) mod_fastcgi/2.4.6 mod_perl/2.0.3 Perl/v5.8.8.
I've installed Flash and successfully tested the demo my.cgi which
comes with Open Flash Chart.
However, when I replace the data generating code in my.cgi
(renamed ofc.1.cgi) with calls to Chart::OFC::* (from the latter's
t/Grid.t and t/Pie.t) I get a HTTP error:
[Sat Jan 05 13:52:40 2008] [error] [client 127.0.0.1] malformed header
from script. Bad header=&pie=80,#000000,#000000&: ofc.1.cgi.
Code:
=====><8=====
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw/:standard/;
use Chart::OFC::Dataset;
use Chart::OFC::Dataset::Bar;
use Chart::OFC::Grid;
use Chart::OFC::Pie;
use Chart::OFC::XAxis;
use Chart::OFC::YAxis;
# ---------------------------
sub swf_object {
my $width = shift;
my $height = shift;
my $url = shift;
print '
codebase="http://fpdownload.macromedia.com/pub/shockwave/cab s/flash/
swflash.cab#version=8,0,0,0" width="400" height="300" id="graph-2"
align="middle">';
print '';
print "
$width&height=$height&data=$url />
\" />";
print '
bgcolor="#FFFFFF" width="'. $width .'" height="'. $height .'"
name="open-flash-chart" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="http://
www.macromedia.com/go/getflashplayer" />';
print '';
}
# ---------------------------
if( !param() ) {
print header, start_html( -title => "Open Flash Demo" );
swf_object( 600, 250, 'http://127.0.0.1/cgi-bin/ofc.1.cgi?data' );
print "