Hey all,

I have some user details that I want placed in this graph.  Probem is my
Perl skills arn't all that good.  Could some one give me some ideas with
the following?

I have a hash here (%users) the Key here is their static IP address.
The value is just some data.  Now the problem I am having is that in my
@data below I need the Key to be placed on the X axis and the data to be
placed on the Y axis.  

%users = (
           '192.168.30.15' => '0.0365829467773438',
           '192.168.30.232' => '0.927815437316895',
           '192.168.30.32' => '0.159876823425293'
         );



my @data = (
  [ "192.168.30.15", "192.168.30.232", "192.168.30.32"],
  [ $valueofhash1,  $valueofhash2,  $valueofhash3,    ],
);

Now the rest is pretty straight foward.  I could manually placed these
in but if someone else is added to the hash then I don't really want to
have to be adding it manually each time to @data.  Could some one give
me some ideas on what I would do here?

something like...

my @data = (
  [ $_[key1$_], $_[key2$_], $_[key3$_]],
  [ $valueofhash1$_,  $valueofhash2$_,  $valueofhash3$_,    ],
);


#  my $my_graph = new GD::Graph::bars();

#  $my_graph->set(
#        x_label => 'User',
#        y_label => 'Data(MB)',
#        title => 'Safilm Internet Usage',
#        y_max_value => 60,
#        y_tick_number => 60,
#        y_label_skip => 2,
#
#        # shadows
#        bar_spacing => 12,
#        shadow_depth => 8,
#        shadowclr => 'dwhite',
#)
#or warn $my_graph->error;

#open PNG, ">usage.png";
#move("usage.png", "./data.jpg")
#    or die "move failed: $!";
#print PNG $my_graph->plot(\@data)->png;
#close PNG;

#my $map = new GD::Graph::Map($my_graph);
#($map->imagemap("./data.png", \@data));

regards,

Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to