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