JavaScript/jQuery Chart - crosshair.horizontalLine.label

Configures the label that belongs to the horizontal crosshair line.

Type:

Object

Crosshair labels can be configured using the following objects.

  • crosshair.horizontalLine.label
    Configures the label of the horizontal crosshair line only.

  • crosshair.verticalLine.label
    Configures the label of the vertical crosshair line only.

  • crosshair.label
    Configures both the labels.

These objects have identical structure, but the label settings declared in the horizontalLine or verticalLine object override the label settings declared directly in the crosshair object.

See Also
  • crosshair.verticalLine.label - configures the label that belongs to the vertical crosshair line.

backgroundColor

Paints the background of the label that belongs to the horizontal crosshair line.

Type:

String

Default Value: '#f05b41'

This option supports the following colors:

customizeText

Customizes the text displayed by the label that belongs to the horizontal crosshair line.

Type:

Function

Function parameters:
info:

Object

Information about the point a user paused on.

Object structure:
Name Type Description
point

Point

The Point object.

value

Date

|

Number

|

String

The raw point value.

valueText

String

The formatted value converted to a string.

Return Value:

String

The text to be displayed in the label that belongs to the horizontal crosshair line.

Cannot be used in themes.

NOTE
As an alternative to the function’s parameter you can use the this keyword.

font

Specifies font options for the label of the horizontal crosshair line.

Type:

Object

format

Formats a point value before it is displayed in the crosshair label.

Type:

Format

Default Value: undefined

See the format section for details on accepted values.

See Also

visible

Makes the label of the horizontal crosshair line visible. Applies only if the crosshair feature is enabled and the horizontal line is visible.

Type:

Boolean

Default Value: false