JavaScript/jQuery 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 property to true. Assign true to the crosshair.label.visible property 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 property supports the following colors:
- Hexadecimal colors
- RGB colors
- RGBA colors
- Predefined/cross-browser color names
- Predefined SVG colors
- Paint server address
dashStyle
The following dash styles are available:
solid
The border is a solid, continuous line.longDash
The border is displayed using long dashes.dash
The border is displayed using dashes.dot
The border is displayed using dots.Any combination of 'longDash', 'dash' and 'dot'
The border is displayed by repeating the specified combination. For instance, 'dashdotdash'.
Use the DashStyle
enum to specify this property when the UI component is used as an ASP.NET MVC 5 Control or a DevExtreme-Based ASP.NET Core Control. 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.
Propertiesdeclared in the horizontalLine and verticalLine objects override the properties 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 properties 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.
Propertiesdeclared in the horizontalLine and verticalLine objects override the properties declared in the crosshair object.