Contents
Login Register Wishes Forum About
Language Reference » Scatter chart » getScatterLegendSize
Help topics
Latest updates
2174d  replaceImageMapTitle
2174d  replaceImageMapValues
2174d  createFunctionSerie
2174d  setAbsicssaPosition
2174d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
getScatterLegendSize- Determine the size of the legend box

This function returns the width and height of the scatter legend box that would be drawn with the specified parameters. You can use this function to align your legend boxes depending of its printed size.

This function will return an associative array containing the Width and Height keys.

Basically you‘ll use the same Format array with this function than the one used for the drawLegend() function.

Calling this function
getScatterLegendSize($Format="");
Where :

Format is an array containing the drawing parameters of the legend.


Customisation array - Tune up your legend!

It is possible to customize the way your legend will be rendered by playing with this array. Providing a detailled configuration is not mandatory, by default the legend will be drawn in a soft grey box with curvy corners.

You can specify the font file that will be used with FontName.
You can specify the font size with FontSize.
You can specify the size of the colored boxes with BoxSize.
You can specify the inner margins with Margin.

You can choose the style that will be applied to you legend box using the Style parameter :

LEGEND_NOBORDER no borders will be drawn around the legend.
LEGEND_BOX a rectangle will be drawn around the legend.
LEGEND_ROUND a rounded rectangle will be drawn around the legend.

You can also define the way the legend will be written using the Mode parameter :

LEGEND_VERTICAL that will stack vertically the series.
LEGEND_HORIZONTAL that will stack horizontally the series.

Sample script

 /* Rounded legend box */
 $myPicture->setFontProperties(array("FontName"=>"fonts/pf_arma_five.ttf","FontSize"=>6));
 $Size = $myPicture->getScatterLegendSize(array("Style"=>LEGEND_ROUND,"Mode"=>LEGEND_HORIZONTAL));

 print_r($Size);
The script will returns an associative array :
Array
(
    [Width] => 123
    [Height] => 23
)
Last updated on 01/26/2011 
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.