rakheek has asked for the wisdom of the Perl Monks concerning the following question:

Hi Friends, I have a script which creates a png graph using perl GD module. It works fine for me on IE but dumps the PNG encrypted stuff for Mozilla firefox. The code for dumping png graph is below. Please advise, if I need any special graphing function for Mozilla firefox.
my $mygraph = GD::Graph::lines->new(); $mygraph->set( x_label => 'Log_Date', y_label => 'Open P1-P2 Bugs', title => 'DEIMOS Data', ); #my @data = (['Fall 01', 'Spr 01', 'Fall 02', 'Spr 02' ], # [80, 90, 85, 75], # [76, 55, 75, 95], # [66, 58, 92, 83]); #print $cgi->end_table; #print 'Content-Type: image/png\n\n'; my @data = (\@log_date, \@deimos_open_bugs); my $myimage = $mygraph->plot(\@data) or die $mygraph->error;

Replies are listed 'Best First'.
Re: perl GD png graph works on IE but does not work on Mozilla
by Khen1950fx (Canon) on Mar 13, 2010 at 01:09 UTC
    This is one module that comes with dozens of examples. Check the source and review sample51..sample57
Re: perl GD png graph works on IE but does not work on Mozilla
by Anonymous Monk on Mar 13, 2010 at 01:09 UTC
    The code for dumping png graph is below. Please advise, if I need any special graphing function for Mozilla firefox.

    The code you have posted is incomplete, it doesn't demonstrate your problem, but does hint that you're confused about CGI. Try again.

      Thanks perl Monk. I needed a line in the header to have png format. It works now.