SetXLabelType — Set formatting type for X tick and data labels
$plot->SetXLabelType($xlt
)
SetXLabelType
sets the formatting type for X tick and
data labels. 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 thousands-separating commas, and with precision set by SetPrecisionX.
'time' formatting formats the labels as date/time values, using a format specifier set by SetXTimeFormat.
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 SetPrecisionX is to call this function SetXLabelType and set the formatting mode to 'data'.
If using 'data' format for labels, you need to turn off X data label display with SetXDataLabelPos if you don't want to use data labels, even if the string values in your data array are empty. This is because with numeric formatting these empty strings will be displayed as the number zero, unless you turn off data label display.