From: hickert Date: Tue, 17 Aug 2010 14:03:53 +0000 (+0000) Subject: Hardened graph generation X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=20ce15a7da2cd3b8a1a9d7097621928aca7fa04f;p=gosa.git Hardened graph generation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19403 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/generic/statistics/class_statistics.inc b/gosa-core/plugins/generic/statistics/class_statistics.inc index 7bd547008..384af4b49 100644 --- a/gosa-core/plugins/generic/statistics/class_statistics.inc +++ b/gosa-core/plugins/generic/statistics/class_statistics.inc @@ -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); }