7 $Usage = "usage: $0 [-e] [-o file] statfile";
9 # -e generate a 3D graph
10 # -o file write the graph to file, instead of starting the viewer
12 getopts
('eo:', \
%Opts)
21 my $chart = shift or die "Need a chart!";
22 my $name = shift or die "Need a name!";
25 open(OUT
, ">$name") or
26 die "Cannot open $name.$ext for write: $!";
28 print OUT
$chart->gd->png();
33 print STDERR
"Processing file $statfile\n";
36 $graph = new GD
::Graph
::bars3d
(800, 600);
38 $graph = new GD
::Graph
::bars
(800, 600);
48 x_labels_vertical
=> 1,
65 $graph->set (overwrite
=> 1);
66 $graph->set (show_values
=> 0);
71 if ($stattitle ne "") {
72 $graph->set (title
=> $stattitle);
75 $outfile = $Opts{'o'};
78 $tmp = $outfile = "/tmp/viewstat" . $$ . ".png";
82 save_chart
($graph, $outfile);