ChartCrosshairProps

Defines the configuration options for the chart crosshair.

Props

The following table outlines the props for the ChartCrosshairProps:

NameTypeDefaultDescription
enable
boolean
false

Enables or disables the crosshair line. When set to true, the crosshair line is visible.

highlightCategory
boolean
false

Highlights the entire category range on hover. This option is applicable only for category axes.

lineStyle
{ color: undefined, width: 1, dashArray: '' }

Specifies the visual style of the crosshair line. You can customize the line's color, width, and dash pattern using the dashArray property.

lineType
Both

Determines the orientation of the crosshair lines. Available options:

  • Both: Displays both vertical and horizontal lines.
  • Vertical: Displays only the vertical line.
  • Horizontal: Displays only the horizontal line.
snap
boolean
true

Specifies whether the crosshair should snap to the nearest data point or follow the mouse pointer. When false, the crosshair freely follows the mouse pointer's X and Y coordinates across the chart.