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