GetLegendSize

GetLegendSize — Return the amount of space required for the legend box

Synopsis

list($width, $height) = $plot->GetLegendSize()

Description

GetLegendSize returns the size (in pixels) required for the legend box. This might be used to adjust the plot margins based on the legend size, for example. After calling GetLegendSize, you can use SetPlotAreaWorld or SetMarginsPixels to leave room for the legend.

Parameters

None

Return Value

Returns an array of two values ($width, $height). These are the width and height required for the box containing the legend.

Notes

This function will return valid numbers after the legend has been set up (including using SetLegend to set all the text lines, and optional calls to set the font, linespacing, and style). The results from this function do not depend on data values, plot type, or other plot elements.

History

This function was added in PHPlot-5.4.0.