[Chicago-talk] GD::Graph
matt boex
chimcentral at yahoo.com
Wed Mar 10 12:38:35 CST 2004
ed,
sure. it's pretty simple. the data that i am importing from tempfile is the output of "uptime", 41,000 times.
matt
#!/usr/bin/perl -w
use GD::Graph::bars;
use GD::Graph::colour;
open (IN,"tempfile");
while (<IN>) {
$_ =~ /load average: (.*?),/;
$data = $1;
push (@undefineme, "");
push (@final, $data);
}
@data = (
[@undefineme],
[@final],
);
#y axis is top down. x is bottom accross.
$my_graph = new GD::Graph::bars(1200,400);
$my_graph->set(
bgclr => "white",
transparent => 0,
x_label => 'Per 30 sec increments',
y_label => 'load',
title => "load",
#y_max_value => 20, default computs from dataset
#y_tick_number => 5,
#y_label_skip => 1,
#x_labels_vertical => 1,
fgclr => "green",
# shadows
#bar_spacing => 2,
#shadow_depth => 4,
#shadowclr => 'dred',
);
my $format = $my_graph->export_format;
open(IMG,">load.png") or die $!;
binmode IMG;
print IMG $my_graph->plot(\@data)->png;
Ed Summers <ehs at pobox.com> wrote:
On Wed, Mar 10, 2004 at 09:38:09AM -0800, matt boex wrote:
> Can't call method "png" on an undefined value ....
Can we see the code? While it's alot of data, I don't think GD::Graph should
have a problem with it.
//Ed
_______________________________________________
Chicago-talk mailing list
Chicago-talk at mail.pm.org
http://mail.pm.org/mailman/listinfo/chicago-talk
---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20040310/c4a9d4f7/attachment.htm
More information about the Chicago-talk
mailing list