windowsforms-devexpress-dot-xtracharts-dot-chartcontrol-dd32a925.md
Gets or sets a value that specifies whether a crosshair cursor is enabled for a chart.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.UI.dll
NuGet Package : DevExpress.Win.Charts
public DefaultBoolean CrosshairEnabled { get; set; }
Public Property CrosshairEnabled As DefaultBoolean
| Type | Description |
|---|---|
| DefaultBoolean |
Default - 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.
|
Available values:
| Name | Description | Return Value |
|---|---|---|
| True |
The value is true.
|
0
| | False |
The value is false.
|
1
| | Default |
The value is specified by a global option or a higher-level object.
|
2
|
Use the CrosshairEnabled property to activate (deactivate) the crosshair cursor at the level of a ChartControl. Use the SeriesBase.CrosshairEnabled and Indicator.CrosshairEnabled properties to enable (disable) the crosshair cursor for specific series and indicators.
To customize the crosshair cursor appearance and position options, use the ChartControl.CrosshairOptions property.
The following image shows the enabled crosshair cursor with the CrosshairOptions.ShowArgumentLabels, CrosshairOptions.ShowValueLabels, CrosshairOptions.ShowArgumentLine and CrosshairOptions.ShowValueLine set to true.
To customize the crosshair cursor label content, use the SeriesBase.CrosshairLabelPattern property for series and the Indicator.CrosshairLabelPattern property — for indicators.
For more information on how to use a crosshair cursor, see the Crosshair Cursor topic.
The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.
winforms-chart-drill-down/CS/Form1.cs#L68
if (e.Series[0].View is StackedBarSeriesView) {
chartControl.CrosshairEnabled = DefaultBoolean.False;
chartControl.ToolTipEnabled = DefaultBoolean.True;
winforms-chart-drill-down/VB/Form1.vb#L77
If TypeOf e.Series(0).View Is StackedBarSeriesView Then
chartControl.CrosshairEnabled = DefaultBoolean.[False]
chartControl.ToolTipEnabled = DefaultBoolean.[True]
See Also