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>SetLegendReverse</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="SetLegendPosition.html" title="SetLegendPosition" /><link rel="next" href="SetLegendStyle.html" title="SetLegendStyle" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetLegendReverse</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetLegendPosition.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a
accesskey="n" href="SetLegendStyle.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetLegendReverse"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetLegendReverse</span></h2><p>SetLegendReverse — Control the order of text lines in the legend</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetLegendReverse(<em class="parameter"><code>$reverse</code></em>)</pre></div><div class="refsect1"><a id="idp1378289412"></a><h2>Description</h2><p>
<code class="function">SetLegendReverse</code> is used to change the order of entries
in the legend.
A legend is drawn if <a class="xref" href="SetLegend.html" title="SetLegend"><span class="refentrytitle">SetLegend</span></a> is used.
The legend consists of a series of text strings and color boxes or shape
markers.
The contents of the legend helps identify the different data sets in the
plot (for example, the separate plot lines).
The legend line identifying the first data set is normally drawn at the top
of the legend, with the rest of the lines in order below it.
<code class="function">SetLegendReverse</code> can be used to reverse that order, so
the line for the first data set is drawn at the bottom of the legend.
</p></div><div class="refsect1"><a id="idp1378291588"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$reverse</code></em></span></dt><dd><p>
True to reverse the order of legend entries (bottom up), False to keep the
default order (top down).
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378293148"></a><h2>Notes</h2><p>
The main use of this function is to set the legend line order for
<a class="link" href="conc-plottypes.html#plottype-stackedarea" title="3.4.14. Plot Type: stackedarea (Stacked Area Plot)">stackedarea</a>,
<a class="link" href="conc-plottypes.html#plottype-stackedbars" title="3.4.15. Plot Type: stackedbars (Stacked Bar Plot)">stackedbars</a>, and
<a class="link" href="conc-plottypes.html#plottype-stackedsquaredarea" title="3.4.16. Plot Type: stackedsquaredarea (Stacked Squared Area Plot)">stackedsquaredarea</a> plots.
In these plot types, the first data set (bar segment or area section) is
plotted along the the bottom of the plot, with subsequent data sets in
order above it. By default, a legend for these plot types will correctly
identify the data sets by color, but the entries in the legend will be in
the opposite order compared to the data sets and colors on the plot.
Use <code class="literal">$plot->SetLegendReverse(True)</code> with these plot types
to keep the legend entries and plotted data sets in the same order.
</p><p>
See <a class="xref" href="ex-stackedbars2.html" title="5.15. Example - Stacked Bars, Unshaded">Section 5.15, “Example - Stacked Bars, Unshaded”</a> for an example showing the legend
ordering reversal, compared to <a class="xref" href="ex-stackedbars1.html" title="5.14. Example - Stacked Bars, Shaded">Section 5.14, “Example - Stacked Bars, Shaded”</a>.
</p></div><div class="refsect1"><a id="idp1378296972"></a><h2>History</h2><p>
This function was added to PHPlot-5.5.0.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetLegendPosition.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="SetLegendStyle.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetLegendPosition </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetLegendStyle</td></tr></table></div></body></html>