~ubuntu-branches/ubuntu/vivid/gosa/vivid

« back to all changes in this revision

Viewing changes to gosa-core/include/pChart/Example25.php

Tags: 2.7.1-1
* New upstream release
* Updated packaging to not include smarty (Closes: #620489)
* Fixed case of POSIX (Closes: #620486)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 /*
 
3
     Example25 : Playing with shadow
 
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(9,9,9,10,10,11,12,14,16,17,18,18,19,19,18,15,12,10,9),"Serie1");
 
13
 $DataSet->AddPoint(array(10,11,11,12,12,13,14,15,17,19,22,24,23,23,22,20,18,16,14),"Serie2");
 
14
 $DataSet->AddPoint(array(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22),"Serie3");
 
15
 $DataSet->AddAllSeries();
 
16
 $DataSet->RemoveSerie("Serie3");
 
17
 $DataSet->SetAbsciseLabelSerie("Serie3");
 
18
 $DataSet->SetSerieName("January","Serie1");
 
19
 $DataSet->SetSerieName("February","Serie2");
 
20
 $DataSet->SetYAxisName("Temperature");
 
21
 $DataSet->SetYAxisUnit("�C");
 
22
 $DataSet->SetXAxisUnit("h");
 
23
 
 
24
 // Initialise the graph
 
25
 $Test = new pChart(700,230);
 
26
 $Test->drawGraphAreaGradient(90,90,90,90,TARGET_BACKGROUND);
 
27
 $Test->setFixedScale(0,40,4);
 
28
 
 
29
 // Graph area setup
 
30
 $Test->setFontProperties("Fonts/pf_arma_five.ttf",6);
 
31
 $Test->setGraphArea(60,40,680,200);
 
32
 $Test->drawGraphArea(200,200,200,FALSE);
 
33
 $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,200,200,200,TRUE,0,2);
 
34
 $Test->drawGraphAreaGradient(40,40,40,-50);
 
35
 $Test->drawGrid(4,TRUE,230,230,230,10);
 
36
 
 
37
 // Draw the line chart
 
38
 $Test->setShadowProperties(3,3,0,0,0,30,4);
 
39
 $Test->drawCubicCurve($DataSet->GetData(),$DataSet->GetDataDescription());
 
40
 $Test->clearShadow();
 
41
 $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,0,-1,-1,-1,TRUE);
 
42
 
 
43
 // Write the title
 
44
 $Test->setFontProperties("Fonts/MankSans.ttf",18);
 
45
 $Test->setShadowProperties(1,1,0,0,0);
 
46
 $Test->drawTitle(0,0,"Average temperatures",255,255,255,700,30,TRUE);
 
47
 $Test->clearShadow();
 
48
 
 
49
 // Draw the legend
 
50
 $Test->setFontProperties("Fonts/tahoma.ttf",8);
 
51
 $Test->drawLegend(610,5,$DataSet->GetDataDescription(),0,0,0,0,0,0,255,255,255,FALSE);
 
52
 
 
53
 // Render the picture
 
54
 $Test->Render("example25.png");
 
55
?>
 
 
b'\\ No newline at end of file'