in reply to Re: Issues graphing multiple data sets on the same graph in GD::Graph
in thread Issues graphing multiple data sets on the same graph in GD::Graph

So far as I know, Gnuplot isn't an option. :(

As for using the multiple arrays to graph the data sets: I knew about that format, but my problem is that I can't hard code anything. The first thing this program is doing is being distributed to a couple international sites, where the groups and tickets we're graphing varies. Thus, everything has to be dynamic.

To further expound on what I'm trying to do (example code):

$userexample .= @users;

make that output

@users = ( [userexample[0]], [userexample[1]], [userexample[2]], );
So on and so forth. Creating the multi-dimensional arrays by hand is something I understand, and I know GD can graph them like that, I'm just trying to figure out how to graph them in a dynamic fashion.

Thanks for the help. :)

Replies are listed 'Best First'.
Re^3: Issues graphing multiple data sets on the same graph in GD::Graph
by zentara (Cardinal) on Nov 12, 2007 at 20:24 UTC
    Well, I'm not sure exactly what your code has to do, but the Array of Array doesn't have to be static. You can push an array onto the AoA. Something like
    @users = ( [userexample[0]], [userexample[1]], [userexample[2]], ); @userexample[3] = (1,2,3,4); push @users, \@userexample[3]; # now # @users = ( # [userexample[0]], # [userexample[1]], # [userexample[2]], # [userexample[3]], # );
    So, you can store the current values, like in a db, push on new arrays, and rebuild the graph.

    Read "perldoc perldsc" for a better explanation of all the possible Perl data structures. There are all sorts of data structures.... HoH, AoA,HoA,AoH,...etc., etc, etc.


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      The example code you posted unfortunately returns a syntax error when I attempt to compile it. I've read the perldsc page, but the examples on there are still somewhat vague to me, and I don't see anything that seems to imply the syntax I'm looking for.

      Sorry if I seem anxious: I've been working on this project for three weeks now, and this is literally the last bug that needs to be ironed out before we roll it into production. (It's also the first real program I've ever written in any language) I'm ready for it to be on the way.

      Edit: The syntax error that was returned was the result of a typo error on my part. Unfortunately, it also doesn't seem to be doing what I'm trying to do. This operator seems to add the numbers together in each arry, the numbers resulting are impossibly high. :(