Overview
- 3 minutes to read
#Overview
The crosshair cursor provides a great level of interactivity by allowing you to track series point coordinates on a chart. It is also used for analyzing data when you need to compare different graphs.
The crosshair cursor is represented by a pair of intersecting horizontal and vertical lines (the value line and the argument line) with the corresponding axis labels (the value labels and the argument labels) at the end of the lines. The crosshair argument line is visible only by default.
See the Crosshair Cursor Customization section to learn how to show the entire crosshair cursor on a chart.
A cursor also contains a label (the crosshair label) that is positioned on the lines' intersection. This label shows the current series point argument and value by default.
NOTE
When you hover over a series point using either a mouse or your finger, it is highlighted automatically, thanks to the Crosshair
To support series points highlighting, series point markers are hidden by default. To display markers on a diagram, set the Marker
When your chart contains two or more series, the crosshair cursor label has the following appearance:
As you can see, each crosshair label contains a group header that helps to operate with numerous data. If you wish to hide the group header, set the CrosshairOptions.ShowGroupHeaders property to false.
NOTE
If a series name is not displayed on a crosshair label, you need to specify it using the Series.
A crosshair cursor is enabled by default. This means that you do not need to write any code to add it to a chart. If you wish to deactivate a crosshair cursor, you can do one of the following:
- Use the ChartControl.CrosshairEnabled property to disable/enable a crosshair cursor at the chart control level;
- Use the XYSeries2D.CrosshairEnabled property to disable/enable a crosshair cursor for a specific series.
The following image illustrates the second approach to enabling a crosshair cursor for two line series only.
NOTE
In the image above, group headers of the crosshair cursor were formatted using the Crosshair
If you need an alternative tool to operate with data, you can use tooltips.
See the Tooltips topic to learn more.