5 * Copyright 2003-2004 (c) Tim Perdue - 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';
39 if ($report->isError()) {
40 exit_error($report->getErrorMessage(),'scm');
43 $group_id = getIntFromRequest('group_id');
44 $g =& group_get_object($group_id);
45 if (!$g || !is_object($g)) {
49 $res = db_query_params ('SELECT month,sum(commits) AS count
52 GROUP BY month ORDER BY month ASC',
56 $report->labels=util_result_column_to_array($res,0);
57 $report->setData($res,1);
58 $report->start_date=$report->labels[0];
59 $report->end_date=$report->labels[count($report->labels)-1];
63 // Create the graph. These two calls are always required
64 $graph = new Graph(640, 480,"auto");
65 $graph->SetMargin(50,10,35,50);
66 $graph->SetScale( "textlin");
68 // Create the linear plot
69 $lineplot =new LinePlot($report->getData());
70 $lineplot ->SetColor("black");
71 $lineplot->SetFillColor("orange");
73 // Add the plot to the graph
74 $graph->Add( $lineplot);
76 //$graph->SetMargin(10,10,25,10);
77 $graph->title->Set($g->getPublicName()." Commits Over Time: ".$report->start_date." - ".$report->end_date);
78 $graph->subtitle->Set(forge_get_config ('forge_name'));
79 //$graph->xaxis-> title->Set("Date" );
80 //$graph->yaxis-> title->Set("Number" );
82 $a=$report->getDates();
83 $graph->xaxis->SetTickLabels($a);
84 $graph->xaxis->SetLabelAngle(90);
85 $graph->xaxis->SetTextLabelInterval(3);