alwin
New pChart user
Joined: Thu Jun 13, 2013 9:03 am Posts: 3
|
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");
|