30 @require_once(
"../class/config.php");
31 if ((@include_once
'Image/Graph.php') === FALSE) {
32 echo
"<p class=\"alert alert-warning\">". _(
"Image_Graph not installed. use 'aptitude install php-pear' then 'pear install --alldeps Image_Graph-devel' to see the graph.").
"</p>";
36 $db->query(
"SELECT COUNT(login) AS count,date_format(created, '%Y-%m') as month FROM `membres` where created is NOT null GROUP BY month ORDER BY month ASC");
38 $Graph =& Image_Graph::factory(
'graph', array(800, 600));
40 Image_Graph::vertical(
41 Image_Graph::factory(
'title', array(_(
'Account creation per month'), 12)),
42 Image_Graph::vertical(
43 $Plotarea = Image_Graph::factory(
'plotarea'),
44 $Legend = Image_Graph::factory(
'legend'),
51 $Legend->setPlotarea($Plotarea);
53 $total =& Image_Graph::factory(
'Image_Graph_Dataset_Trivial');
54 $total->setName(_(
'before the month'));
55 $units =& Image_Graph::factory(
'Image_Graph_Dataset_Trivial');
56 $units->setName(_(
'during the month'));
59 while (
$db->next_record()) {
62 $i +=
$db->f(
'count');
68 $AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
69 $AxisX->setLabelOption(
'showoffset', 1);
70 $AxisX->setLabelInterval(2);
73 $Plot->setLineColor(
'gray');
76 $FillArray =& Image_Graph::factory(
'Image_Graph_Fill_Array');
85 $Marker =&
$Plot->addNew(
'Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
89 $Plot->setDataSelector(Image_Graph::factory(
'Image_Graph_DataSelector_NoZeros'));