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>SetXTimeFormat</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="SetXTickPos.html" title="SetXTickPos" /><link rel="next" href="SetXTitle.html" title="SetXTitle" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetXTimeFormat</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetXTickPos.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetXTitle.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetXTimeFormat"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetXTimeFormat</span></h2><p>SetXTimeFormat — Set date/time formatting string for X labels</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetXTimeFormat(<em class="parameter"><code>$xtf</code></em>)</pre></div><div class="refsect1"><a id="idp1379085412"></a><h2>Description</h2><p>
|
|
|
3 |
<code class="function">SetXTimeFormat</code> sets the formatting string for X tick
|
|
|
4 |
and data labels when 'time' formatting mode for X labels is in effect.
|
|
|
5 |
Use <a class="xref" href="SetXLabelType.html" title="SetXLabelType"><span class="refentrytitle">SetXLabelType</span></a> to select the formatting mode for labels.
|
|
|
6 |
The formatting string is used with the PHP <code class="function">strftime</code>
|
|
|
7 |
to format labels as date/time strings.
|
|
|
8 |
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
|
|
9 |
This function is retained for compatibility, but use of
|
|
|
10 |
<a class="xref" href="SetXLabelType.html" title="SetXLabelType"><span class="refentrytitle">SetXLabelType</span></a> is preferred.
|
|
|
11 |
</p></div></div><div class="refsect1"><a id="idp1379088148"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$xtf</code></em></span></dt><dd><p>
|
|
|
12 |
Formatting string for X labels, used with <code class="function">strftime()</code>.
|
|
|
13 |
For example, if the label value is 1104534000 (which is the
|
|
|
14 |
<code class="literal">time_t</code> representation of 6:00 PM on the last day of 2004),
|
|
|
15 |
'%Y-%m-%d.%H:%M:%S' results in '2004-12-31.18:00:00',
|
|
|
16 |
and '%d %b %Y' results in '31 Dec 2004'.
|
|
|
17 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1379090564"></a><h2>Notes</h2><p>
|
|
|
18 |
This applies to X tick labels, and also to X data labels unless overridden
|
|
|
19 |
by <a class="xref" href="SetXDataLabelType.html" title="SetXDataLabelType"><span class="refentrytitle">SetXDataLabelType</span></a>.
|
|
|
20 |
</p><p>
|
|
|
21 |
To use date/time formatting, the label values must be Unix time_t
|
|
|
22 |
values (number of seconds since Unix epoch).
|
|
|
23 |
</p><p>
|
|
|
24 |
Unlike <a class="xref" href="SetPrecisionX.html" title="SetPrecisionX"><span class="refentrytitle">SetPrecisionX</span></a>, SetXTimeFormat does not
|
|
|
25 |
automatically enable the correct label formatting mode. You
|
|
|
26 |
must call <code class="literal">SetXLabelType('time')</code> to use date/time
|
|
|
27 |
formatting of labels.
|
|
|
28 |
</p><p>
|
|
|
29 |
The default time format is '%H:%M:%S', showing hours, minutes, and seconds
|
|
|
30 |
(and ignoring any date information).
|
|
|
31 |
</p></div><div class="refsect1"><a id="idp1379093300"></a><h2>History</h2><p>
|
|
|
32 |
Starting with PHPlot-5.0.6, the time format can be set with
|
|
|
33 |
<a class="xref" href="SetXLabelType.html" title="SetXLabelType"><span class="refentrytitle">SetXLabelType</span></a> instead.
|
|
|
34 |
</p><p>
|
|
|
35 |
The default time format was undefined prior to PHPlot-5.0rc3.
|
|
|
36 |
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetXTickPos.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="SetXTitle.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetXTickPos </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetXTitle</td></tr></table></div></body></html>
|