pChart 2.x forum http://wiki.pchart.net/forum/ |
|
Bar char x-axis label not showing http://wiki.pchart.net/forum/viewtopic.php?f=5&t=39815 |
Page 1 of 1 |
Author: | alwin [ Thu Jun 13, 2013 3:08 pm ] |
Post subject: | Bar char x-axis label not showing |
Hi, I have copied this code from the examples, the scale draws just fine with the y-axis displaying it's label, but the x-axis never shows the text 'Months' as per the screenshot in the sample. (code should run as-is, just set the fonts path) Please help $MyData = new pData(); /* Prepare some nice data & axis config */ $MyData->addPoints(array(24,-25,26,25,25),"Temperature"); $MyData->setAxisName(0,"Temperatures"); $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels"); $MyData->setSerieDescription("Labels","Months"); $MyData->setAbscissa("Labels"); /* Define the graph area and do some makeup */ $myPicture = new pImage(800, 800, $MyData); $myPicture->setGraphArea(60,60,660,190); $myPicture->drawText(350,55,"My chart title",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); $myPicture->drawFilledRectangle(60,60,660,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10)); /* Compute and draw the scale */ $myPicture->setFontProperties(array("FontName"=>"pChart2.1.3/fonts/pf_arma_five.ttf","FontSize"=>6)); $myPicture->drawScale(array("DrawSubTicks"=>TRUE,"DrawArrows"=>TRUE,"ArrowSize"=>6)); $myPicture->autoOutput("pictures/example.addRandomValues.png"); |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |