Clownburner has asked for the wisdom of the Perl Monks concerning the following question:
So I did this (most of this code is samples from the man pages, I will be using this with real data once I get the output done properly):$graph->plot(\@data) Plot the chart, and return the GD::Image object.
..Which returns the error:#!/usr/bin/perl use GD::Graph::bars3d; use GD::Text::Wrap; my @data = ( [qw (Sun Mon Tue Wed Thu Fri Sat) ], [ 1100, 1500, 1800, 1950, 2324, 2162, 140], [ 103, 2000, 1173, 908, 232, 1200, 100], ); my $graph = new GD::Graph::bars3d( 495, 211 ); $graph->set( x_label => 'Day of the week', dclrs => [ qw(red dgreen) ], bar_spacing => 10, cumulate => 1, ); my ($gd) = $graph->plot( \@data )->png; my $text = <<EOSTR; Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. EOSTR my $wrapbox = GD::Text::Wrap->new( $gd, line_space => 4, color => 'black', text => $text, ); binmode STDOUT; print $gd;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding text to a GD::Graph object...
by dree (Monsignor) on Jun 22, 2002 at 09:56 UTC | |
by Clownburner (Monk) on Jun 25, 2002 at 19:37 UTC | |
|
Re: Adding text to a GD::Graph object...
by Clownburner (Monk) on Jun 22, 2002 at 01:22 UTC |