rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
I realise its possible to do:#!/usr/bin/perl use strict; use warnings; use GD::Graph::bars; print "Content-type: text/html\n\n"; print "This is a test html page<br>\n"; print "<img src=\"", &draw , "\"><br>\n"; sub draw { my @dates = ( "2000", "2001", "2002", "2003", "2004" ); my @articles = ( 2, 1, 4, 7, 6 ); my @data; @data = ([ @dates ], [ @articles ]); my $graph; $graph = GD::Graph::bars->new(400,200); $graph->set( y_label => "Articles", x_label => "Date", bar_spacing => 3, show_values => 1 ) or die $graph->error; my $gd; $gd = $graph->plot(\@data) or die $graph->error; return "Content-type: image/png\n\n", $gd->png; } # end-sub exit;
but i'm specifically trying to print directly to the HTML page...![]()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing an Image directly to HTML
by fireartist (Chaplain) on Feb 03, 2005 at 11:16 UTC | |
by holli (Abbot) on Feb 03, 2005 at 11:20 UTC | |
by fireartist (Chaplain) on Feb 03, 2005 at 11:24 UTC | |
by zentara (Cardinal) on Feb 03, 2005 at 13:01 UTC | |
by ww (Archbishop) on Feb 03, 2005 at 14:16 UTC | |
|
Re: Printing an Image directly to HTML
by merlyn (Sage) on Feb 03, 2005 at 11:20 UTC | |
by Jaap (Curate) on Feb 03, 2005 at 18:39 UTC | |
by merlyn (Sage) on Feb 03, 2005 at 19:48 UTC | |
|
Re: Printing an Image directly to HTML
by fireartist (Chaplain) on Feb 03, 2005 at 11:32 UTC | |
|
Re: Printing an Image directly to HTML
by Fletch (Bishop) on Feb 03, 2005 at 14:11 UTC | |
|
Re: Printing an Image directly to HTML
by edan (Curate) on Feb 03, 2005 at 11:11 UTC | |
|
Re: Printing an Image directly to HTML
by holli (Abbot) on Feb 03, 2005 at 11:12 UTC |