1 | <?php |
---|
2 | /* |
---|
3 | Naked: Naked and easy! |
---|
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)); |
---|
13 | $DataSet->AddSerie(); |
---|
14 | $DataSet->SetSerieName("Sample data","Serie1"); |
---|
15 | |
---|
16 | // Initialise the graph |
---|
17 | $Test = new pChart(700,230); |
---|
18 | $Test->setFontProperties("Fonts/tahoma.ttf",10); |
---|
19 | $Test->setGraphArea(40,30,680,200); |
---|
20 | $Test->drawGraphArea(252,252,252,TRUE); |
---|
21 | $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2); |
---|
22 | $Test->drawGrid(4,TRUE,230,230,230,70); |
---|
23 | |
---|
24 | // Draw the line graph |
---|
25 | $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription()); |
---|
26 | $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255); |
---|
27 | |
---|
28 | // Finish the graph |
---|
29 | $Test->setFontProperties("Fonts/tahoma.ttf",8); |
---|
30 | $Test->drawLegend(45,35,$DataSet->GetDataDescription(),255,255,255); |
---|
31 | $Test->setFontProperties("Fonts/tahoma.ttf",10); |
---|
32 | $Test->drawTitle(60,22,"My pretty graph",50,50,50,585); |
---|
33 | $Test->Render("Naked.png"); |
---|
34 | ?> |
---|