You could just include the script in a HTML like:#! /usr/local/bin/perl -w use strict; use Apache::Request (); # Apache stuff use GD::Graph::pie; use constant TITLE => "Morning Commute Time: Pie Chart"; my $r = shift; # Apache stuff my $graph = new GD::Graph::pie( 300, 300 ); my @data = ( [ qw( Monday Tuesday Wednesday Thursday Friday ) ], [ 33, 24, 23, 19, 21 ], ); $graph->set( title => TITLE, '3d' => 2 ); my $gd_image = $graph->plot( \@data ); $r->content_type('image/jpg'); # Apache stuff $r->send_http_header; # Apache stuff binmode STDOUT; print $gd_image->jpeg; exit;
At least, you (or I) want to know you can stream binary directly to a browser from your Web server (as opposed to writing a graph to a temporary file).<html><body> <p>My Pie Chart</p> <img src=trygd.pl> </body></html>
In reply to Re: CGI Graphics on Internet Information Server
by chunlou
in thread CGI Graphics on Internet Information Server
by serich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |