Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GD:Graph prob

Status
Not open for further replies.

tommycahir1

Programmer
Feb 20, 2004
34
IE
how do you draw mulitple images on a web page using GD::graph
the following is the code for printing the graph so far.

sub print_graph#prints the graph to screen
{

my $q = new CGI;
my ($xarray,$values,$xlabel,$ylabel,$title,$IfNum) = @_;
my @data = ($xarray,$values);
$title = $title.$IfNum;
my $graph = new GD::Graph::lines(500,350);
$graph->set
(
x_label => $xlabel,
y_label => $ylabel,
title => $title,
x_label_skip => 'auto',
y_label_skip => 'auto',
line_width => 1,
y_tick_number => 8,
x_labels_vertical => 1,
x_label_position => 1/2,
transparent => 0,
);

my $gd_image = $graph->plot(\@data);
print header(-type => "image/png");
binmode STDOUT;
print $gd_image->png;
}

its called twice to print out the number of packets recieved on each interface in a workstation but it only ever prints out the first one. (the software loop back)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top