GD::Graph isn't numeric etc.

From: FB (fransb_at_lumara.nl)
Date: 01/26/05


Date: Wed, 26 Jan 2005 18:43:49 GMT

Hi,

first of all, I must be a fool, thinking I can write monitoring software
using RRDs, Mysql and GD while being a very very newbie in perl..
My problem is, I derive data out of RRD, with theses datapoints I try to
graph using GD.
After running the script it says:
Argument "0.0375,0.0363,0.0282,0.0353,0.0396,0.0370,0.0235,0.0228,..." isn't
numeric in numeric eq (==) at
/usr/lib/perl5/site_perl/5.8.3/GD/Graph/axestype.pm line 1452

The lines in the script are: (I know the sed lines look a 'bit' newbie-like
:-))

==============//=================
push @RRDATA, `$rrdtool fetch $rrddir/$DatabaseName AVERAGE |/bin/grep -v
ds |/bin/grep -v nan |/usr/bin/tail -12`;
foreach $_ (@RRDATA) {
  ($time, $unerr, $corr, $uncorr, $uncorrpercent, $corrpercent) = split('
');
  $upct = `printf "%6.4f" $uncorrpercent`;
  $timerecord = join(",",$timerecord,"\"$time\"");
  $timerecord =~ s/^,//g;
  $timerecord =~ s/://g;
  $timerecord = join("$timerecord","\"$time\"");
  $datarecord = join(",",$datarecord, $upct);
  $datarecord =~ s/^,//g;
}

my @data = ([$timerecord],[$datarecord]);
my $mygraph = GD::Graph::bars->new(500, 300);
$mygraph->set(
    x_label => 'Time',
    y_label => 'Cer %',
    title => $DatabaseName,
) or warn $mygraph->error;

my $myimage = $mygraph->plot(\@data) or die $mygraph->error;

print "Content-type: image/png\n\n";
print $myimage->png;

===============//======================
anybody a clue??
Thanks a lot in advance!
Frans



Relevant Pages

  • Re: Returning specific data from a webpage?
    ... Case matters in Perl. ... Please read the posting guidelines for this group. ... actual script itself and so copied and pasted wrong. ... just bash a newbie or find a reason to put them on ignore than help them. ...
    (comp.lang.perl.misc)
  • Re: working example File::Taill
    ... > As a newbie to perl i have problems to get the following script to run ... Thank you for using strict! ... The error messages are because you need to explicitly tell Perl what the ...
    (comp.lang.perl.misc)
  • How do I call a stored procedure using perl DBI and evaluate the output
    ... I'm trying to run sp_dbcmptlevel @dbname='master' from within a perl ... script. ... I'm a newbie to sql server so I may be missing something very basic. ...
    (microsoft.public.sqlserver.programming)
  • Re: working example File::Taill
    ... > As a newbie to perl i have problems to get the following script to run ... I'm fairly new to perl but I believe you should add the line: ... to declare your variables (since you use strict). ...
    (comp.lang.perl.misc)
  • Re: working example File::Taill
    ... >> As a newbie to perl i have problems to get the following script to run ... > to declare your variables. ...
    (comp.lang.perl.misc)