From 8b8b972fa84f6400326f700bd9434e2f257e16d9 Mon Sep 17 00:00:00 2001 From: Refik Hadzialic Date: Tue, 9 Aug 2011 18:53:51 +0200 Subject: Libraries and start code for the output results image --- .../examples/example.drawBarChart.can.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php (limited to 'notFinishedCode/pChart2.1.2/examples/example.drawBarChart.can.php') 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 @@ +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 -- cgit v1.2.3-55-g7522