SetYLabelType

SetYLabelType — Set formatting type for Y tick and data labels

Synopsis

$plot->SetYLabelType($ylt)
    

Description

SetYLabelType sets the formatting type for Y tick and data labels. (Y data labels are only available with bar charts.) By default, there is no special formatting, so the labels are output as-is. Other choices are 'data' and 'time'.

'data' formatting formats the labels as floating point numbers, with digits grouped into thousands (3 digit groups), and with precision set by SetPrecisionX.

'time' formatting formats the labels as date/time values, using a format specifier set by SetYTimeFormat.

Parameters

$ylt

A string indicating the desired formatting mode: 'data' or 'time'.

Notes

The default formatting mode is to do no special formatting of the labels. Strings will be output as-is, and numbers will be output using PHP's default formatting.

A side effect of SetPrecisionY is to call this function SetYLabelType and set the formatting mode to 'data'.

Through PHPlot-5.0rc3, when the formatting mode is 'data' the thousands grouping separator was always a comma, and a period was used as a decimal point. Starting with 5.0.4, PHPlot attempts to get the correct values for your locale. You can set the separator characters yourself instead with SetNumberFormat.