Login Register Wishes Forum About
Language Reference » Drawing functions » writeBounds
Help topics
Latest updates
4640d  replaceImageMapTitle
4640d  replaceImageMapValues
4640d  createFunctionSerie
4640d  setAbsicssaPosition
4640d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
writeBounds - Write the min/max values over your chart

This function allows you to write the series boundaries (max, min, both) over your charts. All the drawing parameters are given trough a $Format array. To learn more about this please read the Format array guide.

This function must be called after a charting function because some of them introduce a X offset on the series

Calling this function
Where :

Type can be either BOUND_MIN, BOUND_MAX or BOUND_BOTH depending of what you want to display.
Format is an array containing the drawing parameters of the arrow.

Customisation array - Tune up your rendering!

It is possible to customize the rendering by playing with this array. Providing a detailled configuration is not mandatory, by default both min & max boundaries will be written with different colors.

The text displayed for the max. value can be set with MaxLabelTxt.
The text displayed for the min. value can be set with MinLabelTxt.
The series you want to exclude can be listed in an array named ExcludedSeries.
The offset between the data point and the label can be adjusted with DisplayOffset.
You can decide to draw a box under the caption setting DrawBox. to TRUE.

If you choose to draw a box under the caption, all the drawText() extended styles can be used (DrawBoxBorder,BorderOffset,BoxRounded, ...) to have the complete list of parameters, take a look at the drawText() page.

The label coloring method can be defined setting DisplayColor to :

DISPLAY_MANUAL if you want to define specific colors, then use MaxDisplayR, MaxDisplayG, MaxDisplayB and MinDisplayR, MinDisplayG, MinDisplayB to define it.
DISPLAY_AUTO if you want automatic coloring.

You can specify if the labels will be written on top or under the data point setting MinLabelPos and MaxLabelPos to :

BOUND_LABEL_POS_TOP to display the label on top of the point.
BOUND_LABEL_POS_BOTTOM to display the label under the point.
BOUND_LABEL_POS_AUTO for automatic positioning.

Sample script

 /* pChart library inclusions */

 /* Create and populate the pData object */
 $MyData = new pData();  
 $MyData->addPoints(array(2,7,5,18,VOID,12,10,15,8,5,6,9),"Help Desk");

 /* Create the pChart object */
 $myPicture = new pImage(700,230,$MyData);

 /* Do some cosmetics */
 $myPicture->drawText(35,115,"Recorded cases",array("R"=>255,"G"=>255,"B"=>255,"FontSize"=>20,"Angle"=>90,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));

 /* Draw a spline chart */

 /* Write the data bounds */

 /* Write the chart legend */ 

 /* Render the picture (choose the best way) */
Last updated on 12/25/2010 
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. 415 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.