summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.poll.php
diff options
context:
space:
mode:
Diffstat (limited to 'notFinishedCode/pChart2.1.2/examples/example.drawBarChart.poll.php')
-rw-r--r--notFinishedCode/pChart2.1.2/examples/example.drawBarChart.poll.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.poll.php b/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.poll.php
new file mode 100644
index 0000000..6c94792
--- /dev/null
+++ b/notFinishedCode/pChart2.1.2/examples/example.drawBarChart.poll.php
@@ -0,0 +1,42 @@
+<?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->addPoints(array(60,30,10),"Answers");
+ $MyData->setAxisName(0,"Answers (%)");
+ $MyData->addPoints(array("I do agree ","I disagree ","No opinion "),"Options");
+ $MyData->setAbscissa("Options");
+
+ /* Create the pChart object */
+ $myPicture = new pImage(500,220,$MyData);
+
+ /* Write the chart title */
+ $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>15));
+ $myPicture->drawText(20,34,"Q: Flexibility is a key point of this library",array("FontSize"=>20));
+
+ /* Define the default font */
+ $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6));
+
+ /* Set the graph area */
+ $myPicture->setGraphArea(70,60,480,200);
+ $myPicture->drawGradientArea(70,60,480,200,DIRECTION_HORIZONTAL,array("StartR"=>200,"StartG"=>200,"StartB"=>200,"EndR"=>240,"EndG"=>240,"EndB"=>240,"Alpha"=>30));
+
+ /* Draw the chart scale */
+ $scaleSettings = array("DrawXLines"=>FALSE,"Mode"=>SCALE_MODE_START0,"GridR"=>0,"GridG"=>0,"GridB"=>0,"GridAlpha"=>10,"Pos"=>SCALE_POS_TOPBOTTOM);
+ $myPicture->drawScale($scaleSettings);
+
+ /* Turn on shadow computing */
+ $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
+
+ /* Draw the chart */
+ $myPicture->drawBarChart(array("Rounded"=>TRUE,"Surrounding"=>30));
+
+ /* Render the picture (choose the best way) */
+ $myPicture->autoOutput("pictures/example.drawBarChart.poll.png");
+?> \ No newline at end of file