SetYTimeFormat — Set date/time formatting string for Y labels
$plot->SetYTimeFormat($ytf
)
SetYTimeFormat
sets the formatting string for Y tick
and data labels when 'time' formatting mode for Y labels is in effect.
(Y data labels are only available with bar charts.)
Use SetYLabelType to select the formatting mode for labels.
The formatting string is used with the PHP strftime
to format labels as date/time strings.
$ytf
Formatting string for Y labels, used with strftime()
.
For example, if the label value is 1104534000 (which is the
time_t
representation of 6:00 PM on the last day of 2004),
'%Y-%m-%d.%H:%M:%S' results in '2004-12-31.18:00:00',
and '%d %b %Y' results in '31 Dec 2004'.
This applies to Y tick labels and Y data labels on bar charts. To use date/time formatting, the label values must be Unix time_t values (number of seconds since Unix epoch).
Unlike SetPrecisionY, SetYTimeFormat does not
automatically enable the correct label formatting mode. You
must call SetYLabelType('time')
to use date/time
formatting of labels.
The default time format is '%H:%M:%S', showing hours, minutes, and seconds (and ignoring any date information). This default applies to PHPlot-5.0rc3 and higher. In older versions, the default is undefined.