1 | <?php |
---|
2 | /* |
---|
3 | Example14: A smooth flat 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("Jan","Feb","Mar","Apr","May"),"Serie2"); |
---|
14 | $DataSet->AddAllSeries(); |
---|
15 | $DataSet->SetAbsciseLabelSerie("Serie2"); |
---|
16 | |
---|
17 | // Initialise the graph |
---|
18 | $Test = new pChart(300,200); |
---|
19 | $Test->loadColorPalette("Sample/softtones.txt"); |
---|
20 | $Test->drawFilledRoundedRectangle(7,7,293,193,5,240,240,240); |
---|
21 | $Test->drawRoundedRectangle(5,5,295,195,5,230,230,230); |
---|
22 | |
---|
23 | // This will draw a shadow under the pie chart |
---|
24 | $Test->drawFilledCircle(122,102,70,200,200,200); |
---|
25 | |
---|
26 | // Draw the pie chart |
---|
27 | $Test->setFontProperties("Fonts/tahoma.ttf",8); |
---|
28 | $Test->AntialiasQuality = 0; |
---|
29 | $Test->drawBasicPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),120,100,70,PIE_PERCENTAGE,255,255,218); |
---|
30 | $Test->drawPieLegend(230,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250); |
---|
31 | |
---|
32 | $Test->Render("example14.png"); |
---|
33 | ?> |
---|