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 }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |