SetPrecisionY

SetPrecisionY — Set precision for numeric formated Y labels

Synopsis

$plot->SetPrecisionY($prec)

Description

SetPrecisionY sets the desired numeric precision for Y tick and data labels, and also enables 'data' mode formatting of those labels with SetYLabelType.

Note

This function is retained for compatibility, but use of SetYLabelType is preferred.

Parameters

$prec

The desired numeric precision. This is the number of decimal positions to output.

Notes

Setting numeric precision with this function automatically enables 'data' mode formatting as if SetYLabelType('data') was called.

The default is to format numbers with 1 decimal position, but only if 'data' mode formatting is selected.

This function applies to both Y tick labels and Y data labels. (Y data labels are data value labels within the plot area for vertical plots, or axis data labels for horizontal plots. See Section 3.6, “Labels” for more on labels.) Using 'data' format for Y axis data labels only makes sense when your data array contains numeric data in the label position.

See SetPrecisionX for X tick and data labels.

This function also affects pie chart labels, for backward compatibility. When drawing a pie chart, if SetPieLabelType was not called, and SetPrecisionY was called, then the precision set with SetPrecisionY is used when formatting pie chart labels.

History

Starting with PHPlot-5.0.6, using SetPrecisionY($n) is exactly the same as calling SetYLabelType('data', $n).

SourceForge.net Logo

This version of the manual was produced for the PHPlot Sourceforge project web service site, which requires the logo on each page.

To download a logo-free copy of the manual, see the PHPlot project downloads area.