summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php
diff options
context:
space:
mode:
authorRefik Hadzialic2011-08-09 18:53:51 +0200
committerRefik Hadzialic2011-08-09 18:53:51 +0200
commit8b8b972fa84f6400326f700bd9434e2f257e16d9 (patch)
treed436ed11821797412b7f6671687cf1113c33b2a9 /notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php
parentinsert information for smart test on the help message (diff)
downloadgsm-selftest-8b8b972fa84f6400326f700bd9434e2f257e16d9.tar.gz
gsm-selftest-8b8b972fa84f6400326f700bd9434e2f257e16d9.tar.xz
gsm-selftest-8b8b972fa84f6400326f700bd9434e2f257e16d9.zip
Libraries and start code for the output results image
Diffstat (limited to 'notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php')
-rw-r--r--notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php b/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php
new file mode 100644
index 0000000..901f102
--- /dev/null
+++ b/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php
@@ -0,0 +1,41 @@
+<?php
+ /* CAT:Bar Chart */
+
+ /* pChart library inclusions */
+ include("../class/pData.class.php");
+ include("../class/pDraw.class.php");
+ include("../class/pImage.class.php");
+
+ /* Create and populate the pData object */
+ $MyData = new pData();
+ $MyData->loadPalette("../palettes/light.color",TRUE);
+ $MyData->addPoints(array(150,220,300,-250,-420,-200,300,200,100),"Server A");
+ $MyData->addPoints(array(140,0,340,-300,-320,-300,200,100,50),"Server B");
+ $MyData->setAxisName(0,"Hits");
+ $MyData->addPoints(array("January","February","March","April","May","Juin","July","August","September"),"Months");
+ $MyData->setSerieDescription("Months","Month");
+ $MyData->setAbscissa("Months");
+
+ /* Create the pChart object */
+ $myPicture = new pImage(700,230,$MyData);
+ $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>100));
+ $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array("StartR"=>240,"StartG"=>240,"StartB"=>240,"EndR"=>180,"EndG"=>180,"EndB"=>180,"Alpha"=>20));
+ $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6));
+
+ /* Draw the scale */
+ $myPicture->setGraphArea(50,30,680,200);
+ $myPicture->drawScale(array("CycleBackground"=>TRUE,"DrawSubTicks"=>TRUE,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10));
+
+ /* Turn on shadow computing */
+ $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
+
+ /* Draw the chart */
+ $settings = array("Gradient"=>TRUE,"GradientMode"=>GRADIENT_EFFECT_CAN,"DisplayPos"=>LABEL_POS_INSIDE,"DisplayValues"=>TRUE,"DisplayR"=>255,"DisplayG"=>255,"DisplayB"=>255,"DisplayShadow"=>TRUE,"Surrounding"=>10);
+ $myPicture->drawBarChart($settings);
+
+ /* Write the chart legend */
+ $myPicture->drawLegend(580,12,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));
+
+ /* Render the picture (choose the best way) */
+ $myPicture->autoOutput("pictures/example.drawBarChart.can.png");
+?> \ No newline at end of file