Skip to main content

Crosshair Cursor Customization

  • 4 minutes to read

This topic describes different ways of customizing crosshair cursor elements and formatting crosshair label content, and contains examples on how this can be done in your application.

#Interaction Customization

You can specify how the crosshair cursor should interact with chart series points in one of the following ways:

#Formatting Crosshair Cursor Content

Use a pattern of crosshair axis and crosshair cursor labels

As you can see in the image above, crosshair axis labels and crosshair cursor labels show series point argument and values.

You can change the default format of text displayed within the crosshair labels by specifying a pattern (e.g., only show point values). This can be done using the CrosshairAxisLabelOptions.Pattern, XYSeries2D.CrosshairLabelPattern and CrosshairOptions.GroupHeaderPattern properties.

A full list of available placeholders is detailed below.

Pattern Description
{A} Displays a series point argument.
{V} Displays series point values.
{VP} Displays series point values as percentages (for a Pie and Donut, Nested Donut series and Full-Stacked series).
{S} Displays the name of the series.
{G} Displays the name of a stacked group.
{W} Displays the weight (for a Bubble series).
{V1} Displays the first value (for a Range Area series).
{V2} Displays the second value (for a Range Area series).
{VD} Displays the duration between the first and second data point values (for a Range Area series).
{HV} Displays the high value (for a Financial Series series).
{LV} Displays the low value (for a Financial Series series).
{OV} Displays the open value (for a Financial Series series).
{CV} Displays the close value (for a Financial Series series).

The following image shows the XYSeries2D.CrosshairLabelPattern property set to "{S}: {A} - {V}".

FormatCrosshairLabels

Examples

For real-life examples on how this can be done, see the following tutorial:

#Appearance Customization

The chart control provides numerous ways to customize the appearance (e.g., to change the default color, dash style and thickness of crosshair value lines) of all crosshair elements:

Examples

The following examples demonstrate how you can specify custom appearance of the crosshair cursor.

To learn more on chart interaction, see the Tooltips, Animation and Hit-Testing topics.

See Also