Code

Hardened graph generation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Aug 2010 14:03:53 +0000 (14:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Aug 2010 14:03:53 +0000 (14:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19403 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/generic/statistics/class_statistics.inc

index 7bd54700896561720b2c7f0a58aa6ff72e07d5c5..384af4b499d862519599206750a708b2ab081348 100644 (file)
@@ -149,9 +149,11 @@ class statistics extends plugin
 
                             // Do not append empty data                            
                             if(empty($category)) continue;
-                            $dataArray[$category][$date] = log($count + 1);
+                            if($count) $count = log($count);
+                            $dataArray[$category][$date] = $count;
                         }
-                       
+                      
                         // Do not append empty data 
                         if(empty($category)) continue;
 
@@ -168,6 +170,8 @@ class statistics extends plugin
                     }
                     ksort($dates);
 
+
+
                     $DataSet2->AddAllSeries();  
 
                     // Prepare date strings for X-Axis, only print a given number of 
@@ -189,7 +193,7 @@ class statistics extends plugin
                     $DataSet2->RemoveSerie('date');  
 
                     $Test2 = new pChart(700,230);  
-                    $Test2->setFixedScale(0,$max);  
+                    $Test2->setFixedScale(1,$max);  
                     $Test2->setFontProperties("./themes/default/fonts/LiberationSans-Regular.ttf",10);  
                     $Test2->setGraphArea(50,30,585,200);  
                     $Test2->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);  
@@ -201,11 +205,13 @@ class statistics extends plugin
 
                     if(count($dates)){
                         $Test2->drawScale($DataSet2->GetData(),$DataSet2->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);     
+                        $DataSet2->RemoveSerie('date');
                     }
 
                     // Draw the cubic curve graph  
                     if(count($dataArray)){
                         $Test2->drawFilledCubicCurve($DataSet2->GetData(),$DataSet2->GetDataDescription(),.1,20);  
+ #                       $Test2->drawLineGraph($DataSet2->GetData(),$DataSet2->GetDataDescription());
                         $Test2->drawLegend(600,30,$DataSet2->GetDataDescription(),255,255,255);  
                     }