summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3668e68)
raw | patch | inline | side by side (parent: 3668e68)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 Aug 2010 10:49:53 +0000 (10:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 12 Aug 2010 10:49:53 +0000 (10:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19384 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/generic/statistics/class_statistics.inc | patch | blob | history |
diff --git a/gosa-core/plugins/generic/statistics/class_statistics.inc b/gosa-core/plugins/generic/statistics/class_statistics.inc
index 42b74f7030e723c7b1882e7f1b4d3af67ddae5b1..d927e3056e872c446fe659c62961534186df3e29 100644 (file)
$tmp = array();
$DataSet2 = new pData;
- $cnt = 5;
+ $cnt = 2;
foreach($res['category_count'] as $category => $count){
for($i = 0; $i < 10; $i++){
- $tmp[$category][] = rand(0,16);
+ $tmp[$category][time() - ($i*60*60*24)] = rand(0,16);
}
$DataSet2->AddPoint($tmp[$category], $category);
- $DataSet2->SetSerieName($category,$category);
+ $DataSet2->SetSerieName(_($category), $category);
$cnt --;
if(!$cnt) break;
}
-
$DataSet2->AddAllSeries();
- $DataSet2->SetAbsciseLabelSerie();
+
+ // Build up X-Axis
+ $steps = 10;
+ $it = 24*60*60;
+ $start = time() - ($steps * $it);
+ $stop = time();
+ $DataDescription = array();
+ for($i = $start; $i < $stop; $i += $it){
+ $seriesX[] = date('d .m', $i);
+# $seriesX[] = $i;
+ }
+# $DataSet2->SetXAxisFormat("date");
+ $DataSet2->AddPoint($seriesX, 'date');
+ $DataSet2->SetAbsciseLabelSerie('date');
+ $DataSet2->RemoveSerie('date');
# // Initialise the graph
$Test2 = new pChart(700,230);
$Test2->drawCubicCurve($DataSet2->GetData(),$DataSet2->GetDataDescription());
// Finish the graph
+ $DataSet2->RemoveSerie('date');
$Test2->drawLegend(600,30,$DataSet2->GetDataDescription(),255,255,255);
$Test2->drawTitle(50,22,"Plugin usage over time",50,50,50,585);