Code

Updated statistics graph to be of type Pie
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Aug 2010 08:28:07 +0000 (08:28 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Aug 2010 08:28:07 +0000 (08:28 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19379 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 63c51f72f9d0b69757ddb07f4c31652fb2eaf3d0..30fe2cfe5553e5889984a08687cc09e7c853867f 100644 (file)
@@ -74,8 +74,18 @@ class statistics extends plugin
 
 
                 $this->graphID_1 = preg_replace("/[^0-9]/","",microtime(TRUE));
-                $plot = new PHPlot();
+                $plot = new PHPlot(600,400);
+                $plot->SetImageBorderType('plain');
+
+                $plot->SetTitle("World Gold Production, 1990\n(1000s of Troy Ounces)");
+                $plot->SetPlotType('pie');
+                $plot->SetDataType('text-data-single');
                 $plot->SetDataValues($data);
+
+                foreach ($data as $row)
+                    $plot->SetLegend(implode(': ', $row));
+
+
                 $plot->SetOutputFile('/tmp/graph_'.$this->graphID_1);
                 $plot->SetIsInline(TRUE);
                 $plot->DrawGraph();