tommycahir has asked for the wisdom of the Perl Monks concerning the following question:
where the two arrays @x_axis_array and @values_array have been previously filled in a while loop this code had been working before i tried to put it in a while loop so i no that the values are been filled into the arrays properly.. tanx in advance tommycahiruse CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use Socket; use Net::SNMP; use GD::Graph::lines; #function to print out a graph to screen using gd::graph sub print_graph#prints the graph to screen { my $q = new CGI; my ($xarray,$values,$xlabel,$ylabel,$title) = shift(@_); my @data = ($xarray,$values); 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 $q->header(-type => "image/png"); binmode STDOUT; print $gd_image->png; } my $graphxlabel = "Time"; my $graphylabel = "No. Of Packets Recieved"; my $graphtitle = "No. Of Packets Recieved On Interface"; #function call print_graph(\@x_axis_array,\@values_array,\$grap +hxlabel,\$graphylabel,\$graphtitle);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing multiple items to a subroutine
by Grygonos (Chaplain) on Mar 08, 2004 at 13:52 UTC | |
by tommycahir (Acolyte) on Mar 08, 2004 at 15:38 UTC | |
by Grygonos (Chaplain) on Mar 08, 2004 at 16:21 UTC | |
|
Re: passing multiple items to a subroutine
by Crian (Curate) on Mar 08, 2004 at 13:44 UTC | |
by Anonymous Monk on Mar 08, 2004 at 13:48 UTC | |
| |
|
Re: passing multiple items to a subroutine
by Hena (Friar) on Mar 08, 2004 at 14:02 UTC |