Blame | Last modification | View Log | RSS feed
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>GetLegendSize</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="reference.html" title="PHPlot Function Reference" /><link rel="prev" href="GetDeviceXY.html" title="GetDeviceXY" /><link rel="next" href="PHPlot.html" title="PHPlot" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">GetLegendSize</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="GetDeviceXY.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="PHPlot.html">Next</
a></td></tr></table><hr /></div><div class="refentry"><a id="GetLegendSize"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">GetLegendSize</span></h2><p>GetLegendSize — Return the amount of space required for the legend box</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">list($width, $height) = $plot->GetLegendSize()</pre></div><div class="refsect1"><a id="idp1377733676"></a><h2>Description</h2><p>
<code class="function">GetLegendSize</code> 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 <code class="function">GetLegendSize</code>,
you can use <a class="xref" href="SetPlotAreaWorld.html" title="SetPlotAreaWorld"><span class="refentrytitle">SetPlotAreaWorld</span></a> or
<a class="xref" href="SetMarginsPixels.html" title="SetMarginsPixels"><span class="refentrytitle">SetMarginsPixels</span></a> to leave room for the legend.
</p></div><div class="refsect1"><a id="idp1377735916"></a><h2>Parameters</h2><p>
None
</p></div><div class="refsect1"><a id="idp1377736524"></a><h2>Return Value</h2><p>
Returns an array of two values ($width, $height). These are the width and
height required for the box containing the legend.
Returns FALSE if no legend has been defined.
</p></div><div class="refsect1"><a id="idp1377737284"></a><h2>Notes</h2><p>
This function will return valid numbers after the legend has been set up
(including using <a class="xref" href="SetLegend.html" title="SetLegend"><span class="refentrytitle">SetLegend</span></a> 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.
</p></div><div class="refsect1"><a id="idp1377738508"></a><h2>History</h2><p>
Starting with PHPlot-6.0.0, the function returns FALSE if no legend has
been defined yet. (In previous versions, the result was undefined if there
was no legend defined.)
</p><p>
This function was added in PHPlot-5.4.0.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="GetDeviceXY.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="PHPlot.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">GetDeviceXY </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> PHPlot</td></tr></table></div></body></html>