in reply to Re: Histogram in Perl
in thread Histogram in Perl
Thank You very much. The example is working. since i need 3 histograms, I tried using subroutine call to draw the h +istogram chart & i am not getting the results. the code in main is as follows: my $image2 = Covarion_Modules::draw_hist(\@hist); open(IMG, '>hist.png') or die $!; binmode IMG; print IMG $image2->png; and the subroutine is : sub draw_hist{ my ($h) = @_; use CGI ':standard'; use GD::Graph::histogram; @data = @$h; my $graph = new GD::Graph::histogram(400,600); $graph->set( y_label => 'Count', x_label => 'Data', title => 'A Histogram Chart', x_labels_vertical => 1, bar_spacing => 0, shadow_depth => 1, shadowclr => 'dred', transparent => 0, ) or warn $graph->error; my $image = $graph->plot(\@data) or die $graph->error; return($image); } I am getting the error: Useless use of a constant in void context at /usr/lib/perl5/site_perl/ +5.8.0/GD/Graph/histogram.pm line 203. Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5. +8.0/GD/Graph/histogram.pm line 42. Argument "" isn't numeric in numeric eq (==) at /usr/lib/perl5/site_pe +rl/5.8.0/GD/Graph/histogram.pm line 181. Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5. +8.0/GD/Graph/histogram.pm line 42. Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5. +8.0/GD/Graph/histogram.pm line 42. any suggestions please
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Histogram in Perl
by atcroft (Abbot) on Feb 18, 2005 at 04:24 UTC | |
by Anonymous Monk on Feb 18, 2005 at 05:12 UTC | |
by Jaya (Acolyte) on Feb 18, 2005 at 07:13 UTC |