Contents
Login Register Wishes Forum About
Language Reference » Dataset functions » setAbscissa
Help topics
Latest updates
2028d  replaceImageMapTitle
2028d  replaceImageMapValues
2028d  createFunctionSerie
2028d  setAbsicssaPosition
2028d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
setAbscissa - Define the abscissa axis labels serie

This function allow you to associate a data series to the abscissa labels of you chart. This function can be used in a lot of circumstances like for displaying dates, hours, or pure text labels on the abscissa axis.

When selecting a serie as Abscissa axis labels, this serie is marked as "non drawable"

Calling this function
setAbscissa($Serie);

Where :

Serie is the name of the serie that will be used to label the abscissa axis.

Sample script #1

 /* Create the pData object */
 $MyData = new pData(); 

 /* Populate some data */
 $MyData->addPoints(array(1,2,3,4),"My Serie 1");
 $MyData->addPoints(array("Jan","Feb","Mar","Apr"),"My Serie 2");

 /* Use "My Serie 2" as abscissa axis labels */
 $MyData->setAbscissa("My Serie 2");

Labels "Jan","Feb","Mar","Apr" will be used on the abscissa axis.
Sample script #2



 $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->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"=>"fonts/pf_arma_five.ttf","FontSize"=>6));
 $myPicture->drawScale(array("DrawSubTicks"=>TRUE));
Last updated on 12/03/2009 
by Jean-Damien 
Linked resources
  There is no linked topic yet.
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 409 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.