GURU's

I changed the script per the guidelines and the junk has gone away but, The
graph still dosn't showup on the web page. I did tryed to change the
header_props() before calling the showgraph() as well and tryed tp put an &
before the showgraph() as well. What am I still missing??

The changed code is as below:

sub main {
.....
showgraph();

print $q->end_html();

}

sub showgraph{

  use GD::Graph;
  use CGI qw(:standard);
  use GD::Graph::bars;

  my $self = shift;
  my $q = $self->query();

  die "Can't open the data file\n" unless open(DF,"<c:/temp/grph.txt");

  my @data = ( 
    ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"],
    [    1,    2,    5,    6,    3,  1.5,    1,     3,     4],
    [ sort { $a <=> $b } (1, 2, 5, 6, 3, 1.5, 1, 3, 4) ]
  );

  my $graph = GD::Graph::bars->new(400, 300);

  my $graph->set( 
      x_label           => 'X Label',
      y_label           => 'Y label',
      title             => 'Some simple graph'
  );

  my $gd = $graph->plot(\@data);

  my $format = $graph->export_format;
  $self->header_props({-type=>'image/png'});
  #  print header("image/$format");
  #  binmode STDOUT;
  #  print $graph->plot(\@data)->$format();
  return $graph->plot(\@data)->$format();

}

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to