View unanswered posts | View active topics It is currently Thu Mar 28, 2024 11:34 pm



Reply to topic  [ 1 post ] 
Bar char x-axis label not showing 
Author Message
New pChart user
New pChart user

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


Thu Jun 13, 2013 3:08 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron