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