Skip to content

Documentation / @finchart/react / Crosshair

Function: Crosshair() ​

Crosshair(props): null

Defined in: react/src/components/crosshair.tsx:32

A crosshair that follows the cursor.

tsx
<Crosshair />

A decoration, not a series. It belongs to the chart and doesn't touch any value axis, so placing it inside or outside a pane makes no difference — it crosses both panes.

To receive the cursor position as a value, use <ChartContainer onCrosshair>. That's independent of this decoration, so you can turn the crosshair off and still get the value.

Inline objects like format are fine to pass — when the reference changes, only the options get re-applied. This used to rebuild the whole decoration.

Parameters ​

props ​

CrosshairLineOptions

Returns ​

null