Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: (jeffa) Re: Question about using hash indexes with GD::Graph

by vonman (Acolyte)
on Mar 20, 2001 at 21:15 UTC ( [id://65744]=note: print w/replies, xml ) Need Help??


in reply to (jeffa) Re: Question about using hash indexes with GD::Graph
in thread Question about using hash indexes with GD::Graph

This is perfect except that I had to cange the foreach lines to look like follows.
my (@h,@c); push @h, $_->{'hour'} foreach(@data); push @c, $_->{'count'} foreach(@data); my $new = [ \@h, \@c];
Now it is graphing correctly

Replies are listed 'Best First'.
Re: Re: (jeffa) Re: Question about using hash indexes with GD::Graph
by merlyn (Sage) on Mar 20, 2001 at 21:23 UTC
    Any kind of push @x, .... for @y should immediately invoke that magic three-letter word, "m a p".
    my $new = [ [map $_->{hour}, @data], [map $_->{count}, @data] ];

    -- Randal L. Schwartz, Perl hacker

      Man, I was *this* close to getting that. Nice! Thanks once again, Randal!

      Jeff

      R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
      L-L--L-L--L-L--L-L--L-L--L-L--L-L--
      

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://65744]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found