|
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 |