label

Specifies options for argument axis labels.

Type: Object

Axis labels represent textual values for axis ticks, which are not visible by default. To specify custom settings for the argument axis labels, use the label configuration object. To set a common value for labels on all axes, use the commonAxisSettings | label configuration object. This object exposes the properties that can be specified for labels on all axes at once. Note that values specified for the argument axis individually (in the argumentAxis | label object) override values that are specified for all axes (in the commonAxisSettings | label object).

Show Example:
jQuery

In the following example, the argument axis labels are rotated by 45 degrees. In addition, an indent from the argument axis is set to 25 pixels.


                                    

                                    

alignment

Specifies the label's position relative to the tick (grid line).

Type: String
Default Value: undefined
Accepted Values: 'left' | 'center' | 'right'

Show Example:
jQuery

Use the drop-down list in the bottom to change the alignment option of the argument axis labels.


                                    

                                    

customizeText

Specifies a callback function that returns the text to be displayed by argument axis labels.

Type: function

When implementing a callback function for this property, use the argument value to be displayed in a label. These values can be accessed using the following properties of the this object.

  • value
    Specifies the axis argument that is currently represented.
  • valueText
    Specifies the value of the currently represented argument with applied formatting if the format and precision (optional) properties are specified.

The function's parameter represents the same object as the this object. If appropriate, you can use the function's parameter to obtain the value that is currently represented by a label.

For general information on data formatting, refer to the Data Formatting topic.

Show Example:
jQuery

In the example below, an additional text is appended to the argument axis label values using the customizeText option.


                                    

                                    

font

Specifies font options for axis labels.

Type: Object

Show Example:
jQuery

In this example, the text of the argument axis' labels is colored in black and enlarged up to the size of 15 pixels.


                                    

                                    

format

Specifies a format for the text displayed by axis labels.

Type: String
Default Value: ''
Accepted Values: 'currency' | 'fixedPoint' | 'percent' | 'decimal' | 'exponential' | 'largeNumber' | 'thousands' | 'millions' | 'billions' | 'trillions' | 'longDate' | 'longTime' | 'monthAndDay' | 'monthAndYear' | 'quarterAndYear' | 'shortDate' | 'shortTime' | 'millisecond' | 'day' | 'month' | 'quarter' | 'year'

Labels display axis values. You can apply formatting to the label text by using one of the available formats.

NOTE: You can set a precision for a label text when the 'fixedPoint', 'exponential', 'currency' or 'percent' format is applied. Use the precision property to do this.

For details on formatting provided, refer to the Data Formatting topic.

Show Example:
jQuery

The example below represents a chart with formatted argument axis labels. The format of these labels is set to 'fixedPoint' using the format option.


                                    

                                    

indentFromAxis

Specifies the spacing between an axis and its labels in pixels.

Type: Number
Default Value: 10

IdentFromAxis ChartJS

overlappingBehavior

Specifies the overlap resolving algorithm to be applied to axis labels.

Type: String|Object
Default Value: 'enlargeTickInterval'
Accepted Values: object|'ignore' | 'stagger' | 'rotate' | 'enlargeTickInterval'

It is recommended that you set the overlappingBehavior configuration property because labels may overlap when resizing the parent window, or when rotating the device that displays the chart.

When labels overlap, you can specify how these labels will be displayed by setting the overlappingBehavior property to one of the following values:

  • ignore
    Leave the labels overlapped.
  • stagger
    Arrange labels in a staggered manner. The spacing between label rows will be 5 pixels.
  • rotate
    Rotate labels so that they are perpendicular to the axis.
  • enlargeTickInterval
    Leave the labels as they are, but enlarge the axis tick intervals so that the labels do not overlap.

To set the custom spacing between staggered rows or the custom rotation angle for the 'stagger' and 'rotate' modes, assign an object to the overlappingBehavior configuration property. Set the object's mode property to the required mode, and set the staggeringSpacing or rotationAngle property to the required value.

Show Example:
jQuery

In the following example, the argument axis tick interval is intentionally set to a very small value so that the labels overlap each other. The overlap is resolved by rotating the labels by 80 degrees.


                                    

                                    

precision

Specifies a precision for the formatted value displayed in the axis labels.

Type: Number
Default Value: 0

This property's value must be an integer indicating the number of digits to show in the axis values displayed in labels. This property value is used when labels display axis values in one of the following numeric formats: 'fixedPoint', 'exponential', 'currency' or 'percent'. To learn how to set a format for axis values, refer to the format property description.

For general information on data formatting, refer to the Data Formatting topic.

Show Example:
jQuery

The example below represents a chart with formatted argument axis labels. The format of these labels is set to 'fixedPoint' using the format option and the presicion is set to 2 using the precision option.


                                    

                                    

rotationAngle

Specifies the angle that must be used to rotate the axis labels from their initial position.

Type: Number
Default Value: 0

Show Example:
jQuery

In the following example, the argument axis labels are rotated by 30 degrees.


                                    

                                    

staggered

Indicates whether to stagger a horizontal axis labels in two rows.

Type: Boolean
Default Value: false
Accepted Values: true|false

Show Example:
jQuery

In this example, the argument axis labels are staggered with 2-pixel spacing.


                                    

                                    

staggeringSpacing

Specifies, in pixels, the spacing between staggered rows where horizontal axis labels are located.

Type: Number
Default Value: 5

StaggeringSpacing ChartJS

visible

Indicates whether or not axis labels are visible.

Type: Boolean
Default Value: false
Accepted Values: true|false

Show Example:
jQuery

Use the check box in the bottom to change visibility of the argument axis' labels.