Skip to main content

ChartControlBase.CrosshairEnabled Property

Gets or sets a value that specifies whether a crosshair cursor is enabled for a chart.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.2.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public bool? CrosshairEnabled { get; set; }

Property Value

Type Description
Nullable<Boolean>

Null - a crosshair cursor’s state (enabled/disabled) is automatically determined based on the type of diagram currently displayed on a chart; True - a crosshair cursor is enabled for a chart; False - a crosshair cursor is disabled.

Remarks

Use the CrosshairEnabled property to activate (deactivate) a crosshair cursor at the level of a ChartControl.

After that, it becomes possible to customize a crosshair cursor’s appearance and position on a diagram via the ChartControl.CrosshairOptions property.

You can also change the content of a crosshair label, via the XYSeries2D.CrosshairLabelPattern property and crosshair label appearance using the XYSeries2D.CrosshairLabelTemplate property.

The following table shows this property in action.

CrosshairEnabled=True CrosshairEnabled=False
ChartControl - CrosshairEnabled - True ChartControl - CrosshairEnabled - False

Note

The CrosshairOptionsBase.ShowCrosshairLabels and CrosshairOptions.ShowArgumentLine properties are enabled by default.

To show series point markers on a diagram, set the MarkerVisible property for a particular series to true (e.g., LineSeries2D.MarkerVisible).

To learn more about the crosshair cursor, see the Crosshair Cursor topic.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CrosshairEnabled property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also