1 | <?php |
---|
2 | /* |
---|
3 | Example10 : A 3D exploded pie 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->AddPoint(array(10,2,3,5,3),"Serie1"); |
---|
13 | $DataSet->AddPoint(array("January","February","March","April","May"),"Serie2"); |
---|
14 | $DataSet->AddAllSeries(); |
---|
15 | $DataSet->SetAbsciseLabelSerie("Serie2"); |
---|
16 | |
---|
17 | // Initialise the graph |
---|
18 | $Test = new pChart(420,250); |
---|
19 | $Test->drawFilledRoundedRectangle(7,7,413,243,5,240,240,240); |
---|
20 | $Test->drawRoundedRectangle(5,5,415,245,5,230,230,230); |
---|
21 | $Test->createColorGradientPalette(195,204,56,223,110,41,5); |
---|
22 | |
---|
23 | // Draw the pie chart |
---|
24 | $Test->setFontProperties("Fonts/tahoma.ttf",8); |
---|
25 | $Test->AntialiasQuality = 0; |
---|
26 | $Test->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),180,130,110,PIE_PERCENTAGE_LABEL,FALSE,50,20,5); |
---|
27 | $Test->drawPieLegend(330,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250); |
---|
28 | |
---|
29 | // Write the title |
---|
30 | $Test->setFontProperties("Fonts/MankSans.ttf",10); |
---|
31 | $Test->drawTitle(10,20,"Sales per month",100,100,100); |
---|
32 | |
---|
33 | $Test->Render("example10.png"); |
---|
34 | ?> |
---|