~josephjamesmills/zpanelcp/zpanelcp

« back to all changes in this revision

Viewing changes to var/www/zpanel/lib/pChart2/examples/imageMap/scripts/3DRing.php

  • Committer: Joseph Mills
  • Date: 2012-05-09 02:52:32 UTC
  • Revision ID: josephjamesmills@gmail.com-20120509025232-ob5xni0ggrse28c0
setup framwork for www

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php   
 
2
 /* Library settings */
 
3
 define("CLASS_PATH", "../../../class");
 
4
 define("FONT_PATH", "../../../fonts");
 
5
 
 
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");
 
11
 
 
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");
 
16
 
 
17
 /* Define the absissa serie */
 
18
 $MyData->addPoints(array("<10","10<>20","20<>40","40<>60","60<>80",">80"),"Labels");
 
19
 $MyData->setAbscissa("Labels");
 
20
 
 
21
 /* Create the pChart object */
 
22
 $myPicture = new pImage(300,260,$MyData);
 
23
 
 
24
 /* Retrieve the image map */
 
25
 if (isset($_GET["ImageMap"]) || isset($_POST["ImageMap"]))
 
26
  $myPicture->dumpImageMap("ImageMap3DRingChart",IMAGE_MAP_STORAGE_FILE,"3DRingChart","../tmp");
 
27
 
 
28
 /* Set the image map name */
 
29
 $myPicture->initialiseImageMap("ImageMap3DRingChart",IMAGE_MAP_STORAGE_FILE,"3DRingChart","../tmp");
 
30
 
 
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);
 
34
 
 
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);
 
38
 
 
39
 /* Add a border to the picture */
 
40
 $myPicture->drawRectangle(0,0,299,259,array("R"=>0,"G"=>0,"B"=>0));
 
41
 
 
42
 /* Set the default font properties */ 
 
43
 $myPicture->setFontProperties(array("FontName"=>FONT_PATH."/Forgotte.ttf","FontSize"=>10,"R"=>80,"G"=>80,"B"=>80));
 
44
 
 
45
 /* Create the pPie object */ 
 
46
 $Settings = array("RecordImageMap"=>TRUE);
 
47
 $PieChart = new pPie($myPicture,$MyData,$Settings);
 
48
 
 
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);
 
52
 
 
53
 /* Render the picture (choose the best way) */
 
54
 $myPicture->autoOutput("../tmp/3DRingChart.png");
 
55
?>
 
 
b'\\ No newline at end of file'