98 |
- |
1 |
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
|
|
|
2 |
<!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>SetXDataLabelPos</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="SetXDataLabelAngle.html" title="SetXDataLabelAngle" /><link rel="next" href="SetXDataLabelType.html" title="SetXDataLabelType" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetXDataLabelPos</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetXDataLabelAngle.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetXDataLabelType.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetXDataLabelPos"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetXDataLabelPos</span></h2><p>SetXDataLabelPos — Position and control X data labels</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetXDataLabelPos(<em class="parameter"><code>$xdlp</code></em>)</pre></div><div class="refsect1"><a id="idp1378869668"></a><h2>Description</h2><p>
|
|
|
3 |
<code class="function">SetXDataLabelPos</code> determines if and where X data labels
|
|
|
4 |
are drawn.
|
|
|
5 |
For vertical plots, these are X axis data labels, which display the label
|
|
|
6 |
strings from your data array.
|
|
|
7 |
The labels can be drawn at the bottom of the plot (below the X axis),
|
|
|
8 |
above the plot, in both positions, or neither.
|
|
|
9 |
For horizontal plots, these are X data value labels, displaying the value of the
|
|
|
10 |
data point within the plot area.
|
|
|
11 |
</p></div><div class="refsect1"><a id="idp1378871012"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$xdlp</code></em></span></dt><dd><p>
|
|
|
12 |
A string indicating the desired position for the X data labels:
|
|
|
13 |
</p><div class="informaltable"><table summary="X data label position choices" border="1"><colgroup><col class="c1" /><col class="c2" /></colgroup><thead><tr><th>Position</th><th>Description</th></tr></thead><tbody><tr><td>plotdown</td><td>Data labels below the plot.
|
|
|
14 |
This is for vertical plots.</td></tr><tr><td>plotup</td><td>Data labels above the plot.
|
|
|
15 |
This is for vertical plots.</td></tr><tr><td>both</td><td>Data labels both below and above the plot.
|
|
|
16 |
This is for vertical plots.</td></tr><tr><td>plotin</td><td>Data value labels within the plot area.
|
|
|
17 |
For bar charts, this displays the value to the right
|
|
|
18 |
(or left) of each bar.
|
|
|
19 |
For stacked bar charts, this display only the bar total
|
|
|
20 |
labels and not the bar segment labels.
|
|
|
21 |
For other plot types, see notes below.
|
|
|
22 |
</td></tr><tr><td>plotstack</td><td>Data value labels to the right (or left) of each bar,
|
|
|
23 |
and just left of the end of each bar segment.
|
|
|
24 |
This is valid for horizontal stacked bar plots only.
|
|
|
25 |
It turns on both bar total labels (as with 'plotin')
|
|
|
26 |
and bar segment labels.
|
|
|
27 |
</td></tr><tr><td>none</td><td>No data labels or data value labels</td></tr></tbody></table></div><p>
|
|
|
28 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1378879924"></a><h2>Notes</h2><p>
|
|
|
29 |
With vertical plots, this function controls the X axis data labels.
|
|
|
30 |
For an example, see <a class="xref" href="ex-area1.html" title="5.3. Example - Area Plot">Section 5.3, “Example - Area Plot”</a>,
|
|
|
31 |
where the labels are enabled by default and displayed below the X axis.
|
|
|
32 |
With horizontal plots, this function controls the X data value labels.
|
|
|
33 |
For examples, see <a class="xref" href="ex-horizbar.html#example-horizbar" title="Example 5.27. Horizontal Bar Chart">Example 5.27, “Horizontal Bar Chart”</a>
|
|
|
34 |
and <a class="xref" href="ex-horizstackedbar.html#example-horizstackedbar" title="Example 5.28. Horizontal Stacked Bar Chart">Example 5.28, “Horizontal Stacked Bar Chart”</a>.
|
|
|
35 |
</p><p>
|
|
|
36 |
The default position for X data labels (for vertical plots) is below the plot.
|
|
|
37 |
However, PHPlot only enables the data labels if SetXDataLabelPos was used to
|
|
|
38 |
position them, or if <a class="xref" href="SetXTickLabelPos.html" title="SetXTickLabelPos"><span class="refentrytitle">SetXTickLabelPos</span></a> was not used to
|
|
|
39 |
enable the tick labels and the data labels are not all empty.
|
|
|
40 |
</p><p>
|
|
|
41 |
The default position for X data value labels (for horizontal plots) is 'none',
|
|
|
42 |
meaning no labels.
|
|
|
43 |
For plot types 'bars' and 'stackedbars', X data value labels are drawn
|
|
|
44 |
(if enabled) at fixed positions within or left/right of the bars.
|
|
|
45 |
For plot types 'lines', 'points', and 'linepoints', X data labels
|
|
|
46 |
are drawn (if enabled) above the data points by default.
|
|
|
47 |
The position can be changed (see <a class="xref" href="adv-tuning.html#adv-tuning-labels" title="4.7.7. Tuning Labels">Section 4.7.7, “Tuning Labels”</a>), but
|
|
|
48 |
PHPlot does not attempt to prevent interference between the labels and
|
|
|
49 |
other plot elements.
|
|
|
50 |
X data value labels are not available with other plot types.
|
|
|
51 |
</p><p>
|
|
|
52 |
For tick labels, see <a class="xref" href="SetXTickLabelPos.html" title="SetXTickLabelPos"><span class="refentrytitle">SetXTickLabelPos</span></a>.
|
|
|
53 |
</p><p>
|
|
|
54 |
The bar segment labels, if enabled ('plotstack'), are drawn inside the bars
|
|
|
55 |
and may not be very visible if dark colors are used for the bar fill.
|
|
|
56 |
Bar segment labels will be omitted for segments which are too short.
|
|
|
57 |
</p><p>
|
|
|
58 |
X data value labels will be drawn to the left of the bars for negative values.
|
|
|
59 |
This only applies to horizontal bar charts.
|
|
|
60 |
Stacked bar charts are not allowed to have negative values.
|
|
|
61 |
</p><p>
|
|
|
62 |
If X data label lines are enabled with <a class="xref" href="SetDrawXDataLabelLines.html" title="SetDrawXDataLabelLines"><span class="refentrytitle">SetDrawXDataLabelLines</span></a>,
|
|
|
63 |
then SetXDataLabelPos() also determines the direction of the lines which
|
|
|
64 |
are drawn from the data points.
|
|
|
65 |
</p><p>
|
|
|
66 |
The X data label text angle is set with <a class="xref" href="SetXDataLabelAngle.html" title="SetXDataLabelAngle"><span class="refentrytitle">SetXDataLabelAngle</span></a>.
|
|
|
67 |
The X data label text format can be controlled with
|
|
|
68 |
<a class="xref" href="SetXDataLabelType.html" title="SetXDataLabelType"><span class="refentrytitle">SetXDataLabelType</span></a> or <a class="xref" href="SetXLabelType.html" title="SetXLabelType"><span class="refentrytitle">SetXLabelType</span></a>.
|
|
|
69 |
</p><p>
|
|
|
70 |
X data value labels do work with horizontal error plots (plot types 'lines',
|
|
|
71 |
'points', and 'linepoints' and data type
|
|
|
72 |
<a class="link" href="conc-datatypes.html#data-data-yx-error">data-data-yx-error</a>).
|
|
|
73 |
The labels will identify the base X values of the points.
|
|
|
74 |
You can change the default label positions (offset and angle) as explained in
|
|
|
75 |
<a class="xref" href="adv-tuning.html#adv-tuning-labels" title="4.7.7. Tuning Labels">Section 4.7.7, “Tuning Labels”</a>).
|
|
|
76 |
</p></div><div class="refsect1"><a id="idp1378888476"></a><h2>History</h2><p>
|
|
|
77 |
Horizontal error plots, with data labels, were first available in PHPlot-6.1.0.
|
|
|
78 |
</p><p>
|
|
|
79 |
Horizontal lines, points, and linepoints plots and data value labels for
|
|
|
80 |
them were first available in PHPlot-6.0.0.
|
|
|
81 |
</p><p>
|
|
|
82 |
Horizontal bar plot data value labels were added in PHPlot-5.1.3.
|
|
|
83 |
Through PHPlot-5.1.2, the 'plotin' and 'plotstack' values were not available.
|
|
|
84 |
</p><p>
|
|
|
85 |
Through PHPlot-5.0.7, the default position for X data labels was below the
|
|
|
86 |
plot ('plotdown').
|
|
|
87 |
This would result in overlaid data and tick labels by default.
|
|
|
88 |
In addition, positioning the X tick labels with
|
|
|
89 |
<a class="xref" href="SetXTickLabelPos.html" title="SetXTickLabelPos"><span class="refentrytitle">SetXTickLabelPos</span></a> with a position other than 'none'
|
|
|
90 |
resulted in disabling the X data labels, and vice-versa.
|
|
|
91 |
If both tick and data labels were positioned, the later setting overrode
|
|
|
92 |
the earlier, which was turned off.
|
|
|
93 |
Starting with PHPlot-5.1.0, PHPlot handles tick and data label positions
|
|
|
94 |
as described in the notes above.
|
|
|
95 |
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetXDataLabelAngle.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="SetXDataLabelType.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetXDataLabelAngle </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetXDataLabelType</td></tr></table></div></body></html>
|