source: trunk/web/addons/job_monarch/lib/pchart/Example19.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     Example19 : Error reporting
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(10,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,30),"Serie2");
14 $DataSet->AddAllSeries();
15 $DataSet->SetAbsciseLabelSerie();
16 $DataSet->SetXAxisName("Samples");
17 $DataSet->SetYAxisName("Temperature");
18 $DataSet->SetSerieName("January","Serie1");
19
20 // Initialise the graph
21 $Test = new pChart(700,230);
22 $Test->reportWarnings("GD");
23 $Test->setFontProperties("Fonts/tahoma.ttf",8);
24 $Test->setGraphArea(60,30,585,185);
25 $Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
26 $Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
27 $Test->drawGraphArea(255,255,255,TRUE);
28 $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
29 $Test->drawGrid(4,TRUE,230,230,230,50);
30
31 // Draw the 0 line
32 $Test->setFontProperties("Fonts/tahoma.ttf",6);
33 $Test->drawTreshold(0,143,55,72,TRUE,TRUE);
34
35 // Draw the cubic curve graph
36 $Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
37
38 // Finish the graph
39 $Test->setFontProperties("Fonts/tahoma.ttf",8);
40 $Test->drawLegend(600,30,$DataSet->GetDataDescription(),255,255,255);
41 $Test->setFontProperties("Fonts/tahoma.ttf",10);
42 $Test->drawTitle(50,22,"Example 19",50,50,50,585);
43 $Test->Render("example19.png");
44?>
Note: See TracBrowser for help on using the repository browser.