3
define("CLASS_PATH", "../../../class");
4
define("FONT_PATH", "../../../fonts");
6
/* pChart library inclusions */
7
include(CLASS_PATH."/pData.class.php");
8
include(CLASS_PATH."/pDraw.class.php");
9
include(CLASS_PATH."/pImage.class.php");
10
include(CLASS_PATH."/pPie.class.php");
12
/* Create and populate the pData object */
13
$MyData = new pData();
14
$MyData->addPoints(array(40,60,15,10,6,4),"ScoreA");
15
$MyData->setSerieDescription("ScoreA","Application A");
17
/* Define the absissa serie */
18
$MyData->addPoints(array("<10","10<>20","20<>40","40<>60","60<>80",">80"),"Labels");
19
$MyData->setAbscissa("Labels");
21
/* Create the pChart object */
22
$myPicture = new pImage(300,260,$MyData);
24
/* Retrieve the image map */
25
if (isset($_GET["ImageMap"]) || isset($_POST["ImageMap"]))
26
$myPicture->dumpImageMap("ImageMap3DRingChart",IMAGE_MAP_STORAGE_FILE,"3DRingChart","../tmp");
28
/* Set the image map name */
29
$myPicture->initialiseImageMap("ImageMap3DRingChart",IMAGE_MAP_STORAGE_FILE,"3DRingChart","../tmp");
31
/* Draw a solid background */
32
$Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107);
33
$myPicture->drawFilledRectangle(0,0,300,300,$Settings);
35
/* Overlay with a gradient */
36
$Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50);
37
$myPicture->drawGradientArea(0,0,300,260,DIRECTION_VERTICAL,$Settings);
39
/* Add a border to the picture */
40
$myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0));
42
/* Set the default font properties */
43
$myPicture->setFontProperties(array("FontName"=>FONT_PATH."/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80));
45
/* Create the pPie object */
46
$Settings = array("RecordImageMap"=>TRUE);
47
$PieChart = new pPie($myPicture,$MyData,$Settings);
49
/* Draw an AA pie chart */
50
$PieSettings = array("InnerRadius"=>30,"OuterRadius"=>80,"DrawLabels"=>TRUE,"Border"=>TRUE,"RecordImageMap"=>TRUE);
51
$PieChart->draw3DRing(160,150,$PieSettings);
53
/* Render the picture (choose the best way) */
54
$myPicture->autoOutput("../tmp/3DRingChart.png");
b'\\ No newline at end of file'