in reply to Question about using hash indexes with GD::Graph
How about:
I really tried to avoid the temp lists, maybe someone will come along and make this puppy scream with a nasty map block. ;)my (@h,@c); push @h, $_->{hour} foreach(@{$data}); # no so great push @c, $_->{count} foreach(@{$data}); # see extremely's comment my $new = [ \@h, \@c ]; $gd = $graph->plot($new); # wrong - see orbital's comme +nt
Data::Dumper - don't code anonymous data structures without it.BEFORE: AFTER: $VAR1 = [ $VAR1 = [ { [ 'count' => 5, 1, 'hour' => 1 5, }, 2 { ], 'count' => 2, [ 'hour' => 5 5, }, 2, { 8 'count' => 8, ] 'hour' => 2 ]; } ];
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--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: Question about using hash indexes with GD::Graph
by extremely (Priest) on Mar 21, 2001 at 02:43 UTC | |
|
Re: (jeffa) Re: Question about using hash indexes with GD::Graph
by vonman (Acolyte) on Mar 20, 2001 at 21:15 UTC | |
by merlyn (Sage) on Mar 20, 2001 at 21:23 UTC | |
by jeffa (Bishop) on Mar 20, 2001 at 21:26 UTC |