[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Collapse]Charts Suite
   [Collapse]Chart Control
    [Expand]Getting Started
    [Expand]Fundamentals
    [Expand]Providing Data
    [Expand]Chart Elements
    [Expand]Appearance Customization
    [Collapse]End-User Features
     [Expand]End-User Capabilities
     [Collapse]Tooltip and Crosshair Cursor
       Tooltip
       Crosshair Cursor
       Crosshair Cursor Customization
       Changing the Crosshair Cursor Layout
      Tooltips
      Hit-Testing
      Selection
     [Expand]Animation
      Print and Export
      Chart Designer for End-Users
    [Expand]Design-Time Features
    [Expand]Examples
    [Expand]Additional Resources
   [Expand]Chart3D Control
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Crosshair Cursor Customization

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.

Expanded Interaction Customization

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

Expanded 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 series).
{V2} Displays the second value (for a Range 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).
{LV} Displays the low value (for a Financial series).
{OV} Displays the open value (for a Financial series).
{CV} Displays the close value (for a Financial series).

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

The Format Specifiers topic explains which standard and custom formats can be used together with placeholders to format numeric and date-time values within a crosshair cursor label.

Examples

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

Expanded 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 the custom appearance of the crosshair cursor.

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

Expanded See Also

Is this topic helpful?​​​​​​​