summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/web/example.drawFilledCircle.php
diff options
context:
space:
mode:
Diffstat (limited to 'notFinishedCode/web/example.drawFilledCircle.php')
-rw-r--r--notFinishedCode/web/example.drawFilledCircle.php45
1 files changed, 44 insertions, 1 deletions
diff --git a/notFinishedCode/web/example.drawFilledCircle.php b/notFinishedCode/web/example.drawFilledCircle.php
index e3735dc..e8e09a0 100644
--- a/notFinishedCode/web/example.drawFilledCircle.php
+++ b/notFinishedCode/web/example.drawFilledCircle.php
@@ -2,6 +2,8 @@
/* CAT:Drawing */
/* pChart library inclusions */
+ include("class/pData.class.php");
+
include("class/pDraw.class.php");
include("class/pImage.class.php");
@@ -18,8 +20,18 @@
return array($x,$y,$Bx,$By,$Cx,$Cy);
}
+ /* Create and populate the pData object */
+ $MyData = new pData();
+ $MyData->addPoints(array(66,100,50,39,28),"Hits");
+ $MyData->setAxisName(0,"Network operability");
+ $MyData->addPoints(array("GSM University","GSM External","SIP","University SIP","Landline"),"Networks");
+ $MyData->setSerieDescription("Networks","Networks");
+ $MyData->setAbscissa("Networks");
+
+
+
/* Create the pChart object */
- $myPicture = new pImage(700,430);
+ $myPicture = new pImage(700,430,$MyData);
/* Draw the background */
$Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107);
@@ -176,6 +188,37 @@
//###############################
+ //LANDLINE
+ /* Turn on shadow computing */
+ $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20));
+ /* Draw a PNG object */
+ $myPicture->drawFromPNG(393,150,$LANDLINECOL);
+ /* Write some text */
+ $myPicture->setFontProperties(array("FontName"=>"fonts/verdana.ttf","FontSize"=>7));
+ $TextSettings = array("DrawBox"=>TRUE,"BoxRounded"=>TRUE,"R"=>0,"G"=>0,"B"=>0,"Angle"=>0,"FontSize"=>7);
+ $myPicture->drawText(238,157,"GSM-Box",$TextSettings);
+ //###############################
+
+
+ //A BIT OF STATISTICS
+ /* Draw the chart scale */
+ $myPicture->setGraphArea(520,50,690,220);
+ $AxisBoundaries = array(0=>array("Min"=>0,"Max"=>100));
+
+ $myPicture->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10,"Pos"=>SCALE_POS_TOPBOTTOM,"Mode"=>SCALE_MODE_MANUAL,"ManualScale"=>$AxisBoundaries));
+
+ /* Turn on shadow computing */
+ $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
+
+ /* Create the per bar palette */
+ $Palette = array("0"=>array("R"=>188,"G"=>224,"B"=>46,"Alpha"=>100),
+ "1"=>array("R"=>224,"G"=>100,"B"=>46,"Alpha"=>100),
+ "2"=>array("R"=>224,"G"=>214,"B"=>46,"Alpha"=>100),
+ "3"=>array("R"=>46,"G"=>151,"B"=>224,"Alpha"=>100),
+ "4"=>array("R"=>224,"G"=>176,"B"=>46,"Alpha"=>100));
+
+ /* Draw the chart */
+ $myPicture->drawBarChart(array("DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"Rounded"=>TRUE,"Surrounding"=>30,"OverrideColors"=>$Palette));
/* Render the picture (choose the best way) */