Code

Applied in_array strict patches from trunk
[gosa.git] / gosa-core / plugins / generic / statistics / chartClasses / class_objectCountChart.inc
index ce543020aac48d4a668fd636074627b42259ebc7..bf62fe4993cc8ad77f3e6a6dff6c0067abeab609 100644 (file)
@@ -15,13 +15,13 @@ class objectCountChart extends statChart
      */ 
     function render()
     {
-        $lineMax = 100;
+        $lineMax = 20;
         $gData = $this->graphData;
         $dataSet = new pData;  
         $seriesCnt = 0;
 
         foreach($gData['objectCountPerInterval'] as $category => $count){
-            if(empty($category) || in_array($category, $this->skipSeries)) continue;
+            if(empty($category) || in_array_strict($category, $this->skipSeries)) continue;
 
             // Add results to our data set.
             $dataSet->AddPoint($count, $category);
@@ -47,7 +47,7 @@ class objectCountChart extends statChart
         $dataSet->SetAbsciseLabelSerie('date');  
 
         // Read graph from cache?
-        $pCache = new pCache('/var/spool/gosa/');
+        $pCache = new pCache($this->cachePath);
         if($this->enableCaching && $pCache->IsInCache(get_class(),$dataSet->GetData())){
             $filename =  $pCache->GetHash(get_class(),$dataSet->GetData());
             $filename = '/var/spool/gosa/'.$filename;    
@@ -59,7 +59,7 @@ class objectCountChart extends statChart
         }
 
         $chart = new pChart(900,230);  
-        $chart->setFixedScale(0.000,$lineMax);
+        $chart->setFixedScale(0,$lineMax);
         $chart->setFontProperties("./themes/default/fonts/LiberationSans-Regular.ttf",10);  
         $chart->setGraphArea(50,28,630,200);  
         $chart->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);  
@@ -73,9 +73,9 @@ class objectCountChart extends statChart
         // Only draw this graph if we've at least one series to draw! 
         if($seriesCnt){
             $chart->drawFilledLineGraph($dataSet->GetData(),$dataSet->GetDataDescription(),50,TRUE);
+            $chart->drawLegend(720,0,$dataSet->GetDataDescription(),255,255,255);
         }
 
-        $chart->drawLegend(720,0,$dataSet->GetDataDescription(),255,255,255);
 
         // Generate new and unique graph id
         $this->graphID = preg_replace("/[^0-9]/","",microtime(TRUE));