source: trunk/web/addons/job_monarch/lib/pchart/Example7.php @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 1.5 KB
Line 
1<?php
2 /*
3     Example7 : A filled cubic curve graph
4 */
5
6 // Standard inclusions   
7 include("pChart/pData.class");
8 include("pChart/pChart.class");
9
10 // Dataset definition
11 $DataSet = new pData;
12 $DataSet->AddPoint(array(1,4,3,2,3,3,2,1,0,7,4,3,2,3,3,5,1,0,7),"Serie1");
13 $DataSet->AddPoint(array(1,4,2,6,2,3,0,1,5,1,2,4,5,2,1,0,6,4,2),"Serie2");
14 $DataSet->AddAllSeries();
15 $DataSet->SetAbsciseLabelSerie();
16 $DataSet->SetSerieName("January","Serie1");
17 $DataSet->SetSerieName("February","Serie2");
18
19 // Initialise the graph
20 $Test = new pChart(700,230);
21 $Test->setFontProperties("Fonts/tahoma.ttf",8);
22 $Test->setGraphArea(50,30,585,200);
23 $Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
24 $Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
25 $Test->drawGraphArea(255,255,255,TRUE);
26 $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
27 $Test->drawGrid(4,TRUE,230,230,230,50);
28
29 // Draw the 0 line
30 $Test->setFontProperties("Fonts/tahoma.ttf",6);
31 $Test->drawTreshold(0,143,55,72,TRUE,TRUE);
32
33 // Draw the cubic curve graph
34 $Test->drawFilledCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription(),.1,50);
35
36 // Finish the graph
37 $Test->setFontProperties("Fonts/tahoma.ttf",8);
38 $Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
39 $Test->setFontProperties("Fonts/tahoma.ttf",10);
40 $Test->drawTitle(50,22,"Example 7",50,50,50,585);
41 $Test->Render("example7.png");
42?>
Note: See TracBrowser for help on using the repository browser.