Dear Monks, A couple of weeks ago, I was approached by my boss, asking me to spend a while learning Perl. The adventure has gone fairly well, and he's been very supportive, but we're starting to run into a few problems. The synopsis:

This program is designed to parse data pulled from a database regarding open securities on our network and their resolutions. The goal is to dynamically pull information for individual users and the assignment groups they fall into based on a series of SQL statements, output data regarding creation an due dates into an HTML file, and graph historical closure rates in an Image which are then embedded into an automated email and sent to group leaders.

It's with the last part that we're running into issues. The goal is to graph all of the users in the group on the same graph. The issue that we're running into is that the program is only outputting the graph for the last listed member of the group.

Here's all the code that should be needed to see what we're doing. If needed, there are a few more initial sections I can post to show what's going on.

# THE PRIMARY ISSUE BEGINS HERE #======================================================== +=== while (@row5 = $sth6->fetchrow_array) { $StatDate = date @row5[0]; $StatField = @row5[1]; $PctClosed = @row5[2]; $c++; push (@DataDate, $StatDate); push (@DataPct, $PctClosed); } #this right curly bracket ends the group of statements tha +t are run once per each user } @data = ( [@DataDate], [@DataPct] ); #Creating the Graph $graph1 = GD::Graph::lines->new(1024, 768); $graph1->set( x_label => 'Date', y_label => '% Closed', title => "$groupname Vulnerability Tickets Clo +sed", y_max_value => 100, y_tick_number => 10, x_label_skip => 7 ) or die $graph->error; $graph1->set( dclrs => [ qw(black dblue gold dgreen dred d +purple lorange dpink marine cyan dbrown lgray lblue lyellow dyellow l +green lred lpurple pink ) ] ); $graph1->set( line_types => [1, 3] ); $graph1->set_legend($longname); my $gd = $graph1->plot(\@data) or die $graph1->error; open (IMG, ">>./$groupname.jpg"); binmode IMG; print IMG $gd->png; close IMG; {Email Statement} } #printing the data output to the html files in the host folder. Th +ese backups can help with debugging issues, as well as insuring that +data is outputting correctly if email is being problematic print RPT "$output"; #this right curly bracket ends the group of statements that are run on +ce for each group }
In a nutshell, what I'm wondering is if anyone knows how to append entire arrays to one another, to create multiple graphable datasets, or can see another way we might be able to achieve the desired result?

In reply to Issues graphing multiple data sets on the same graph in GD::Graph by SoaponaRope

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.