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