React Chart - crosshair
Crosshair is a pointer represented by two mutually-crossing lines stretched over the entire chart plot. The crosshair helps a user identify the values of the series points precisely. When enabled, the crosshair follows the cursor and snaps to the nearest series point.
To enable the crosshair, set the crosshair.enabled option to true. Assign true to the crosshair.label.visible option as well to make the crosshair labels visible.
Settings specified in the crosshair object apply to both the crosshair lines. If you specify the same settings within the horizontalLine or verticalLine object, they will apply to the particular crosshair line only. Note that individual settings override common ones.
color
This option supports the following colors:
- Hexadecimal colors
- RGB colors
- RGBA colors
- Predefined/cross-browser color names
- Predefined SVG colors
dashStyle
This option accepts one of the following values.
- solid
Displays solid, continuous crosshair lines. - dash
Displays the crosshair lines using short dashes. - longDash
Displays the crosshair lines using long dashes. - dot
Displays the crosshair lines using dots. - Any combination of 'longDash', 'dash' and 'dot'
Displays the crosshair lines by repeating the specified combination. For example, 'dashdotdash'.
When using the widget as an ASP.NET MVC Control, specify this option using the DashStyle
enum. This enum accepts the following values: Solid
, LongDash
, Dash
and Dot
.
horizontalLine
Crosshair lines can be configured using the following objects.
crosshair.horizontalLine
Configures the horizontal crosshair line only.crosshair.verticalLine
Configures the vertical crosshair line only.crosshair
Configures both the crosshair lines.
Options declared in the horizontalLine and verticalLine objects override the options declared in the crosshair object.
label
Crosshair labels appear on the chart axes when a user pauses on a series point. They display the argument and the value of this series point.
There are two crosshair labels on a chart - one for each crosshair line, and the label object described here configures both. If you need to set options individually for each label, use the label object within the crosshair.horizontalLine or crosshair.verticalLine object. Individual settings override common ones.
Because the crosshair labels are hidden by default, assign true to the label.visible field if you need them to be shown.
verticalLine
Crosshair lines can be configured using the following objects.
crosshair.horizontalLine
Configures the horizontal crosshair line only.crosshair.verticalLine
Configures the vertical crosshair line only.crosshair
Configures both the crosshair lines.
Options declared in the horizontalLine and verticalLine objects override the options declared in the crosshair object.
If you have technical questions, please create a support ticket in the DevExpress Support Center.