Code

Updated item listing
[gosa.git] / gosa-core / include / pChart / Example6.php
1 <?php\r
2  /*\r
3      Example6 : A simple filled line graph\r
4  */\r
5 \r
6  // Standard inclusions   \r
7  include("pChart/pData.class");\r
8  include("pChart/pChart.class");\r
9 \r
10  // Dataset definition \r
11  $DataSet = new pData;\r
12  $DataSet->ImportFromCSV("Sample/datawithtitle.csv",",",array(1,2,3),TRUE,0);\r
13  $DataSet->AddAllSeries();\r
14  $DataSet->SetAbsciseLabelSerie();\r
15 \r
16  // Initialise the graph\r
17  $Test = new pChart(700,230);\r
18  $Test->setFontProperties("Fonts/tahoma.ttf",8);\r
19  $Test->setGraphArea(60,30,680,200);\r
20  $Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);\r
21  $Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);\r
22  $Test->drawGraphArea(255,255,255,TRUE);\r
23  $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);\r
24  $Test->drawGrid(4,TRUE,230,230,230,50);\r
25 \r
26  // Draw the 0 line\r
27  $Test->setFontProperties("Fonts/tahoma.ttf",6);\r
28  $Test->drawTreshold(0,143,55,72,TRUE,TRUE);\r
29 \r
30  // Draw the filled line graph\r
31  $Test->drawFilledLineGraph($DataSet->GetData(),$DataSet->GetDataDescription(),50,TRUE);\r
32 \r
33  // Finish the graph\r
34  $Test->setFontProperties("Fonts/tahoma.ttf",8);\r
35  $Test->drawLegend(65,35,$DataSet->GetDataDescription(),255,255,255);\r
36  $Test->setFontProperties("Fonts/tahoma.ttf",10);\r
37  $Test->drawTitle(60,22,"Example 6",50,50,50,585);\r
38  $Test->Render("example6.png");\r
39 ?>