5 * Copyright 2003-2004 (c) GForge LLC
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 require_once '../env.inc.php';
24 require_once $gfcommon.'include/pre.php';
25 require_once(forge_get_config('jpgraph_path').'/jpgraph.php');
26 require_once(forge_get_config('jpgraph_path').'/jpgraph_line.php');
27 require_once $gfcommon.'reporting/ReportGroupCum.class.php';
29 session_require_global_perm ('forge_stats', 'read') ;
31 $SPAN = getIntFromRequest('SPAN');
32 $start = getIntFromRequest('start');
33 $end = getIntFromRequest('end');
38 $report=new ReportGroupCum($SPAN,$start,$end);
41 // Check for error, such as license key problem
43 if ($report->isError()) {
44 exit_error($report->getErrorMessage());
48 $ydata = $report->getData();
50 // Create the graph. These two calls are always required
51 $graph = new Graph(640, 480,"auto");
52 $graph->SetMargin(50,10,35,80);
53 $graph->SetScale( "textlin");
55 // Create the linear plot
56 $lineplot =new LinePlot($ydata);
57 $lineplot ->SetColor("black");
58 $lineplot->SetFillColor("orange");
60 // Add the plot to the graph
61 $graph->Add( $lineplot);
63 //$graph->SetMargin(10,10,25,10);
64 $graph->title->Set("Cumulative Projects ".$report->getSpanName()
65 ." (".date('m/d/Y',$report->getStartDate()) ."-". date('m/d/Y',$report->getEndDate()) .")");
66 $graph->subtitle->Set(forge_get_config ('forge_name'));
67 //$graph->xaxis-> title->Set("Date" );
68 //$graph->yaxis-> title->Set("Number" );
70 $a=$report->getDates();
71 $graph->xaxis->SetTickLabels($a);
72 $graph->xaxis->SetLabelAngle(90);
73 $graph->xaxis->SetTextLabelInterval($report->getGraphInterval());