label

An object defining the label configuration options.

Type: Object

Each series point can be accompanied by a text label that represents data related to the point. These are called series point labels. Use the label object's properties to set label options for all chart series at once.

Specify the label object's properties within the commonSeriesSettings configuration object to set label options for all chart series at once.

If you have several series of a single type, you can set label options to the values specific to this series type using the corresponding object (area, line, etc.) within the commonSeriesSettings configuration object. The values that are set within series-type-specific configuration objects override the corresponding common values.

If you need to set a label option for an individual series, use the label object within the series object of the series array. The values that are set individually override the corresponding common values.

Show Example:
jQuery

In this example, point labels are visible.


                                    

                                    

alignment

Specifies how to align point labels relative to the corresponding data points that they represent.

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

Show Example:
jQuery

In this example, you can change the label's alignment option using the drop-down list below.


                                    

                                    

argumentFormat

Specifies a format for arguments displayed by point labels.

Type: String
Default Value: ''

Use this property to set a format for arguments when you are going to display them in point labels. For a listing of acceptable formats, refer to the format property. To learn how to set a custom text for labels so that they include an argument value of the currently represented point, refer to the customizeText property.

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

Show Example:
jQuery

In this example, point labels display dates in the 'monthAndDay' format.


                                    

                                    

argumentPrecision

Specifies a precision for formatted point arguments displayed in point labels.

Type: Number
Default Value: 0

This property's value must be an integer that indicates how many digits to show in the argument displayed in point labels. This property value is considered when labels display arguments in one of the following numeric formats: 'fixedPoint', 'exponential', 'currency', 'percent'. To learn how to set a format for arguments, refer to the argumentFormat property description. To learn how to set a custom text for point labels so that they include an argument value of the currently represented point, refer to the customizeText property description.

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

backgroundColor

Specifies a background color for point labels.

Type: String
Default Value: undefined

Labels are painted in the color of the series whose points they represent by default. You can set a custom background color. For this purpose, use the backgroundColor property of the label object.

Show Example:
jQuery

In this example, the label's backgroundColor option is set to lightskyblue.


                                    

                                    

border

Specifies border options for point labels.

Type: Object

Use this object to make the borders of point labels visible/invisible and set up border options such as color and width.

Show Example:
jQuery

In this example, the label border is colored in darkslateblue.


                                    

                                    

customizeText

Specifies a callback function that returns the text to be displayed by labels of a candleStick series.

Type: function
Function parameters:
pointInfo: Object

Defines the point value to be displayed in a label.

Return Value: String

The text to be displayed in a label.

Cannot be used in themes.

When implementing a callback function for this property, use the point's open, close, high and low values to be displayed in a label. In addition, you can use the argument of the currently displayed value. These values can be accessed using the following properties of the this object.

  • originalOpenValue
    Specifies the open value of the currently represented point as it is set in the data source.
  • openValue
    Specifies the open value of the currently represented point. Differs from the originalOpenValue when the value in the data source is not in a numeric format.
  • openValueText
    Specifies the open value of the currently represented point with applied formatting if the format and precision (optional) properties are specified.
  • originalCloseValue
    Specifies the close value of the currently represented point as it is set in the data source.
  • closeValue
    Specifies the close value of the currently represented point. Differs from the originalCloseValue when the value in the data source is not in a numeric format.
  • closeValueText
    Specifies the close value of the currently represented point with applied formatting if the format and precision (optional) properties are specified.
  • originalHighValue
    Specifies the high value of the currently represented point as it is set in the data source.
  • highValue
    Specifies the high value of the currently represented point. Differs from the originalHighValue when the value in the data source is not in a numeric format.
  • highValueText
    Specifies the high value of the currently represented point with applied formatting if the format and precision (optional) properties are specified.
  • originalLowValue
    Specifies the low value of the currently represented point as it is set in the data source.
  • lowValue
    Specifies the low value of the currently represented point. Differs from the originalLowValue when the value in the data source is not in a numeric format.
  • lowValueText
    Specifies the low value of the currently represented point with applied formatting if the format and precision (optional) properties are specified.
  • reductionValue
    Specifies the reduction value of the currently represented point.
  • reductionValueText
    Specifies the reduction value of the currently represented point with applied formatting if the format and precision (optional) properties are specified.
  • originalArgument
    Specifies the argument value of the currently represented point as it is set in the data source.
  • argument
    Specifies the argument value of the currently represented point. Differs from the originalArgument when the axis' argument type differs from the argument type in the data source. In this instance, argument has the type of the argument axis.
  • argumentText
    Specifies the argument value of the currently represented point with applied formatting if the argumentFormat and argumentPrecision (optional) properties are specified.
  • point
    Provides access to the currently represented point. To learn more about the field and methods of the point object, refer to the Point topic in the "Chart Elements" reference section.
  • seriesName
    Specifies the series of the currently represented point.

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.

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

Show Example:
jQuery

In this example, the customizeText option is used to combine the argument and the close value of each point and display them by the label of its point.


                                    

                                    

font

Specifies font options for the text displayed in point labels.

Type: Object

Show Example:
jQuery

In this example, the font options of the point labels are changed.


                                    

                                    

format

Specifies a format for the text displayed by point 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'

A point label displays the value(s) of the point that the label represents. You can apply formatting to this value by using one of the available formats.

NOTE
You can set a precision for a label value when the 'fixedPoint', 'exponential', 'currency' or 'percent' format is applied. Use the precision and argumentPrecision properties to do this.

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

Show Example:
jQuery

In this example, point labels display values in the 'fixedPoint' format with a precision of 1.


                                    

                                    

horizontalOffset

Specifies how to shift point labels horizontally from their initial positions.

Type: Number
Default Value: 0

Show Example:
jQuery

In this example, the point labels are shifted to the left from their initial positions by 15 pixels using the horizontalOffset option.


                                    

                                    

precision

Specifies a precision for formatted point values displayed in point labels.

Type: Number
Default Value: 0

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

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

Show Example:
jQuery

In this example, point labels display values in the 'fixedPoint' format with a precision of 1.


                                    

                                    

rotationAngle

Specifies the angle used to rotate point labels from their initial position.

Type: Number
Default Value: 0

Show Example:
jQuery

In this example, the point labels are rotated anticlockwise from their initial positions by 30 degrees using the rotationAngle option.


                                    

                                    

verticalOffset

Specifies how to shift point labels vertically from their initial positions.

Type: Number
Default Value: 0

Show Example:
jQuery

In this example, the point labels are shifted upwards from their initial positions by 30 pixels using the verticalOffset option.


                                    

                                    

visible

Specifies the visibility of point labels.

Type: Boolean
Default Value: false

Show Example:
jQuery

Use the check box below to change the visibility of the point labels.