wishartz has asked for the wisdom of the Perl Monks concerning the following question:
All I get is the last value and key from the hash. Please help it's driving me insane.sub reportg{ my( $userjobcount_ref, $userjobcpu_ref, $queuejobsystem_ref, $userjobt +ime_ref, $queue_cpu_summary_ref, $total_ref, $count) = @_; my( $total, $avg, $month_or_day,$user, $queue, $system_cpu); $MW = MainWindow->new; foreach $month_or_day (sort keys %{$queue_cpu_summary_ref}) { foreach $queue (sort keys %{$queue_cpu_summary_ref->{$month_or_day}}) { $usage=sprintf ("%.3f", $$queue_cpu_summary_ref{$month_or_day}{$queue} + / $total * 100); $data = { $queue => $usage }; $ca = $MW->Graph( -type => 'BARS', -ylabel => 'percentage', -xlabel => 'queue', )->pack( -expand => 1, -fill => 'both', ); $ca->configure(-variable => $data); # bind to data
2006-09-27 Retitled by planetscape, as per Monastery guidelines: one-word (or module-only) titles hinder site navigation
Original title: 'Tk:: Graph'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Tk::Graph to graph two-dimensional data
by liverpole (Monsignor) on Sep 26, 2006 at 11:11 UTC | |
by wishartz (Beadle) on Sep 26, 2006 at 11:31 UTC | |
|
Re: Using Tk::Graph to graph two-dimensional data
by zentara (Cardinal) on Sep 26, 2006 at 10:57 UTC | |
|
Re: Using Tk::Graph to graph two-dimensional data
by robot_tourist (Hermit) on Sep 26, 2006 at 10:30 UTC |