Search results

CrosshairSettings API in JavaScript (ES5) Chart API control

Options to configure the crosshair on the chart, which displays lines that follow the mouse cursor and show the axis values of the data points.

Properties

dashArray

string

Specifies the pattern of dashes and gaps used to stroke the crosshair line.

Defaults to

enable

boolean

If set to true, the crosshair line becomes visible.

Defaults to false

horizontalLineColor

string

The color of the horizontal crosshair line accepts values in hex and rgba as valid CSS color strings.

Defaults to

line

BorderModel

The line property allows defining the appearance of the crosshair line, including its color and width.

lineType

LineType

Specifies the line type for the crosshair. The available modes are:

  • None: Both vertical and horizontal crosshair lines are hidden.
  • Both: Displays both the vertical and horizontal crosshair lines.
  • Vertical: Shows only the vertical crosshair line.
  • Horizontal: Shows only the horizontal crosshair line.

Defaults to Both

opacity

number

Specifies the opacity level for the crosshair, which controls its transparency.

Defaults to 1

snapToData

boolean

If set to true, the horizontal crosshair snaps to the nearest data point.

Defaults to false

verticalLineColor

string

The color of the vertical crosshair line accepts values in hex and rgba as valid CSS color strings.

Defaults to