ChartDirector 7.0 (Perl Edition)

Axis.setLabels2


Usage

setLabels2(labels [, formatString ])

Description

Sets the numeric/date/time labels to be used on the axis.

This method is typically used to set the x-axis to enumerated scale. For more details on what is enumerated axis scale, please refer to Axis.setLabels.

This method assumes the labels are in their "native" form (that is, not formatted). Please refer to Date Representation for the native date/time formats supported in ChartDirector.

If the labels are already formatted into human readable form (that is, they are text strings), use Axis.setLabels instead.

One common issue is that there may be too many labels on the axis. In this case, the Axis.setLabelStep method may be used show only a regularly spaced subset of labels on the axis.

For date/time labels, another alternative is to use Axis.setMultiFormat, which uses filters to select important dates/times (such as dates/times representing the start of a month) for display as labels.

A third method to avoid too many labels is to remove some labels by replacing them with NoValue before passing them to ChartDirector. If you want to remove the label text but leave a minor tick, use MinorTickOnly as the label value.

Arguments

ArgumentDefaultDescription
labels(Mandatory)An array of numbers/dates to be used as the axis labels.
formatString""A format string to specified how to format the labels into human readable form. Please refer to Axis.setLabelFormat for the syntax of the format string. An empty string means the format will be automatically determined.

Return Value

A TextBox object representing the prototype of the axis labels. This may be used to fine-tune the appearance of the axis labels.