source: trunk/web/addons/job_monarch/lib/pchart/Example4.php

Last change on this file 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     Example4 : Showing how to draw area
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->ImportFromCSV("Sample/datawithtitle.csv",",",array(1,2,3),TRUE,0);
13 $DataSet->AddSerie("Serie2");
14 $DataSet->SetAbsciseLabelSerie();
15 $DataSet->removeSerieName("Serie1");
16 $DataSet->removeSerieName("Serie3");
17
18 // Initialise the graph
19 $Test = new pChart(700,230);
20 $Test->setFontProperties("Fonts/tahoma.ttf",8);
21 $Test->setGraphArea(60,30,680,200);
22 $Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
23 $Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
24 $Test->drawGraphArea(255,255,255,TRUE);
25 $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
26 $Test->drawGrid(4,TRUE,230,230,230,50);
27
28 // Draw the 0 line
29 $Test->setFontProperties("Fonts/tahoma.ttf",6);
30 $Test->drawTreshold(0,143,55,72,TRUE,TRUE);
31
32 // Draw the area
33 $Test->drawArea($DataSet->GetData(),"Serie1","Serie3",239,238,227,50);
34
35 // Draw the line graph
36 $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
37 $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);
38
39 // Finish the graph
40 $Test->setFontProperties("Fonts/tahoma.ttf",8);
41 $Test->drawLegend(65,35,$DataSet->GetDataDescription(),250,250,250);
42 $Test->setFontProperties("Fonts/tahoma.ttf",10);
43 $Test->drawTitle(60,22,"Example 4",50,50,50,585);
44 $Test->Render("example4.png");
45?>
Note: See TracBrowser for help on using the repository browser.