From 18e936f1cf1d610b928eba9da7d060e4c4bcd1f6 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 24 Aug 2010 08:26:15 +0000 Subject: [PATCH] Added self-made legend git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19431 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/generic/statistics/class_statistics.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gosa-core/plugins/generic/statistics/class_statistics.inc b/gosa-core/plugins/generic/statistics/class_statistics.inc index 93ba75459..4f7d62fa6 100644 --- a/gosa-core/plugins/generic/statistics/class_statistics.inc +++ b/gosa-core/plugins/generic/statistics/class_statistics.inc @@ -410,6 +410,7 @@ class statistics extends plugin $seriesCnt = 0; $gID = 2; $chart = new pChart(800,230); + $seriesShown = 0; foreach($gData['actionsPerInterval'] as $category => $entriesPerDate){ if(empty($category)) continue; @@ -419,8 +420,6 @@ class statistics extends plugin // Set series color $color = $this->legendColors[$seriesCnt]; $legendData[$seriesCnt] = array('name' => $category,'desc'=>$desc,'color' => $color); - list($r,$g,$b) = $color; - $chart->setColorPalette($seriesCnt,$r,$g,$b); // Do not add graph data for skipped series if(!in_array($category, $this->skipSeries[$gID])){ @@ -428,9 +427,14 @@ class statistics extends plugin $dataSet->SetSerieName($desc, $category); $dataSet->AddSerie($category); + list($r,$g,$b) = $color; + $chart->setColorPalette($seriesShown,$r,$g,$b); + // Detect maximum value, to adjust the Y-Axis $tmpMax = max($entriesPerDate); if($tmpMax > $lineMax) $lineMax = $tmpMax; + + $seriesShown ++; } $seriesCnt ++; @@ -462,7 +466,7 @@ class statistics extends plugin // Set the color for the error Series to 'red'. // This has to be done before drawing the legend. - $chart->setColorPalette($seriesCnt,255,0,0); + $chart->setColorPalette($seriesShown,255,0,0); $dataSet->AddPoint($gData['errorsPerInterval'], 'Errors'); $dataSet->SetSerieName(_('Error'), 'Errors'); $dataSet->AddSerie('Errors'); -- 2.30.2