source: trunk/web/addons/job_monarch/chart.php @ 527

Last change on this file since 527 was 527, checked in by ramonb, 13 years ago

job_monarch/chart.php:

  • new pChart pie

job_monarch/overview.php:

  • use pChart pie

job_monarch/index.php:

  • increase memroy limit
File size: 1.2 KB
Line 
1<?php
2
3$values = array();
4$legend = array();
5
6foreach($_GET as $key=>$val)
7{
8        if ($key == "title")
9
10                $title = $val;
11
12        elseif ($key == "size")
13
14                list($size_x, $size_y) = explode("x", $val);
15
16        else
17        {
18                list( $value, $color ) = explode( ",", $val );
19                $values[] = $value;
20                $legend[] = $key;
21        }
22}
23
24#print_r( $values );
25#print_r( $legend );
26
27// Standard inclusions     
28include("./lib/pchart/pData.class"); 
29include("./lib/pchart/pChart.class"); 
30
31// Dataset definition   
32$DataSet = new pData; 
33$DataSet->AddPoint($values,"Serie1"); 
34$DataSet->AddPoint($legend,"Serie2"); 
35$DataSet->AddAllSeries(); 
36$DataSet->SetAbsciseLabelSerie("Serie2"); 
37
38// Initialise the graph 
39$Test = new pChart(380,200); 
40$Test->drawFilledRoundedRectangle(7,7,373,193,5,240,240,240); 
41$Test->drawRoundedRectangle(5,5,375,195,5,230,230,230); 
42
43// Draw the pie chart 
44$Test->setFontProperties("./lib/pchart/tahoma.ttf",8); 
45$Test->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,90,110,TRUE,TRUE,50,20,20); 
46$Test->drawPieLegend(310,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250); 
47
48$Test->drawTitle(60,22,$title,50,50,50,585);
49
50$Test->Stroke();
51?>
Note: See TracBrowser for help on using the repository browser.