I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2005-05-04 00:04:01-07 by pmneve
GDGraph: getting all black gif
Loading about 590 datapoints and getting a solid black chart. Any clues to what I'm doing wrong? Here is the relevant code:
sub graphtest { $my_graph = new GD::Graph::lines(800, 600); my $data = new GD::Graph::Data( [ @{$dataarrays{'time'}} , @{$dataarrays{'page ins (x1000)'}} # , @{$dataarrays{'cpu system %'}}, ] ); $my_graph->set( x_label => 'Time', # y_label => 'Y label', title => 'Load Analysis '.$store, y_max_value => 100, y_tick_number => 6, y_label_skip => 2, x_label_skip => 20, transparent => 0, ); # $my_graph->set_legend( 'page ins (x1000)' ); $my_graph->plot(\@data); &save_chart($my_graph, $receivedir . 'loadanalysis'); } # sub save_chart { my $chart = shift or die "Need a chart!"; my $name = shift or die "Need a name!"; local(*OUT); open(OUT, ">$name.gif") or die "Cannot open $name.gif for write: $!"; binmode OUT; print OUT $chart->gd->gif(); close OUT; }
A dump shows that the arrays seem to be ok. pat
Direct Responses: 414 | Write a response
Posted on 2005-05-04 08:57:13-07 by eserte in response to 413
Re: GDGraph: getting all black gif
You don't have to dereference the arrays in the GD::Graph::Data constructor. It also seems to me that you don't "use strict", because you create $data first but use \@data then.
Direct Responses: Write a response