label

Configures the label that belongs to the horizontal crosshair line.

Type: Object

The label of the horizontal crosshair line indicates the argument of the series point currently focused by the crosshair pointer. The argument is indicated on the argument axis.

To make the label of the horizontal crosshair line visible, assign true to the label | visible field. Additionally, you can change the color of the label's background using the backgroundColor option and specify the font settings of the label's text using the font object.

The options of the crosshair | horizontalLine | label object configure only the label that belongs to the horizontal crosshair line. The same options may be specified for both the labels at once using the label object declared straight in the crosshair object.

backgroundColor

Specifies a color for the background of the label that belongs to the horizontal crosshair line.

Type: String
Default Value: '#f78119'

This option supports the following colors.

  • Hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • Predefined/cross-browser color names
  • Predefined SVG colors (not supported in Internet Explorer 8)

customizeText

Customizes the text displayed by the crosshair label that accompany the horizontal line.

Type: function(info)
Function parameters:
info: Object
Information about the point that is hovered over.
Object structure:
The value of the point that is hovered over.
valueText: String
The value with applied formatting.
point: Point
The point that is hovered over.
Return Value: String
The text to be displayed by the crosshair label accompanying the horizontal line.
Cannot be used in themes.

Implement a callback function returning the required text and assign it to this option. Inside this function, you can access information about the point that is currently hovered over. For this purpose, use the parameter of the function or the this object.

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

font

Specifies font options for the text of the label that belongs to the horizontal crosshair line.

Type: Object

format

Specifies the format of the values displayed by crosshair 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'

By default, crosshair labels display values as they are defined in the data source. You can apply formatting to these values using the format option. Additionally, if you have decided to use a numeric format, you can specify how many figures to keep when rounding the values. For this purpose, use the precision option. For details on formatting, refer to the Data Formatting topic.

precision

Specifies a precision for formatted values.

Type: Number
Default Value: 0

If you have set a numeric format for values, you can use the precision property to specify how many figures to keep when rounding the value. This property accepts integers only. For general information on data formatting, refer to the Data Formatting topic.

visible

Specifies whether the label of the horizontal crosshair line is visible or not.

Type: Boolean
Default Value: false

To make the crosshair label visible, show the horizontalLine first.