5 * Copyright 2004 (c) GForge LLC
7 * @author Tim Perdue tim@gforge.org
10 * This file is part of GForge.
12 * GForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * GForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with GForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 require_once('../env.inc.php');
28 require_once $gfwww.'include/pre.php';
29 require_once($sys_path_to_jpgraph.'/jpgraph.php');
30 require_once($sys_path_to_jpgraph.'/jpgraph_line.php');
31 require_once $gfcommon.'reporting/ReportGroupAdded.class.php';
33 session_require( array('group'=>$sys_stats_group) );
35 $SPAN = getIntFromRequest('SPAN');
36 $start = getIntFromRequest('start');
37 $end = getIntFromRequest('end');
42 $report=new ReportGroupAdded($SPAN,$start,$end);
45 // Check for error, such as license key problem
47 if ($report->isError()) {
48 echo $report->getErrorMessage();
53 $ydata = $report->getData();
55 // Create the graph. These two calls are always required
56 $graph = new Graph(640, 480,"auto");
57 $graph->SetMargin(50,10,35,50);
58 $graph->SetScale( "textlin");
60 // Create the linear plot
61 $lineplot =new LinePlot($ydata);
62 $lineplot ->SetColor("black");
63 $lineplot->SetFillColor("orange");
65 // Add the plot to the graph
66 $graph->Add( $lineplot);
68 //$graph->SetMargin(10,10,25,10);
69 $graph->title->Set("Projects Added ".$report->getSpanName()
70 ." (".date('m/d/Y',$report->getStartDate()) ."-". date('m/d/Y',$report->getEndDate()) .")");
71 $graph->subtitle->Set(forge_get_config ('forge_name'));
72 //$graph->xaxis-> title->Set("Date" );
73 //$graph->yaxis-> title->Set("Number" );
75 $a=$report->getDates();
76 $graph->xaxis->SetTickLabels($a);
77 $graph->xaxis->SetLabelAngle(90);
78 $graph->xaxis->SetTextLabelInterval($report->getGraphInterval());