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--
In reply to (jeffa) Re: Question about using hash indexes with GD::Graph
by jeffa
in thread Question about using hash indexes with GD::Graph
by vonman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |