label

An object defining constant line label options.

Type:

Object

A constant line label shows information on the constant line. You can configure label appearance using the label object. Within this object, you can set font options, a position and text using corresponding fields. In addition, you can specify the horizontal and vertical alignments for the label.

You can set the label options for all the value axis constant lines together. For this purpose, use the valueAxis | constantLineStyle | label object. Note that the options that are set within the valueAxis | constantLine | label object override the corresponding options that are set within the valueAxis | constantLineStyle | label object.

Show Example:
jQuery

In the following example, a number of options for the value axis constant line labels are changed. The "500" and "750" labels are aligned to the bottom, while the "1000" label is positioned outside the chart plot. In addition, all the labels are colored differently.


                                    

                                    

font

Specifies font options for a constant line label.

Type:

Object

Show Example:
jQuery

In this example, each value axis constant line label is displayed in a different color and size.


                                    

                                    

horizontalAlignment

Specifies the horizontal alignment of a constant line label.

Type:

String

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

Show Example:
jQuery

In this example, each value axis constant line label is aligned differently using the horizontalAlignment option.


                                    

                                    

position

Specifies the position of the constant line label relative to the chart plot.

Type:

String

Default Value: 'inside'
Accepted Values: 'inside' | 'outside'

By default, a constant line label is displayed inside the chart plot near the constant line it belongs to. You can place the label outside the plot by setting the position option to 'outside'.

Show Example:
jQuery

In this example, the "1000" label is placed outside the chart plot using the position option.


                                    

                                    

text

Specifies the text to be displayed in a constant line label.

Type:

String

Default Value: undefined

By default, a constant line label shows the value of the constant line. However, the label can display any information you demand. For this purpose, assign the required string to the text option.

Show Example:
jQuery

In this example, the text of the value axis constant line label is changed.


                                    

                                    

verticalAlignment

Specifies the vertical alignment of a constant line label.

Type:

String

Default Value: 'top'
Accepted Values: 'top' | 'center' | 'bottom'

Show Example:
jQuery

In this example, each value axis constant line label is aligned differently using the verticalAlignment option.


                                    

                                    

visible

Indicates whether or not to display labels for the axis constant lines.

Type:

Boolean

Default Value: true