Back to Devexpress

WebChartControl.CrosshairEnabled Property

aspnet-devexpress-dot-xtracharts-dot-web-dot-webchartcontrol-c95b5e2f.md

latest5.3 KB
Original Source

WebChartControl.CrosshairEnabled Property

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

Namespace : DevExpress.XtraCharts.Web

Assembly : DevExpress.XtraCharts.v25.2.Web.dll

NuGet Package : DevExpress.Web.Visualization

Declaration

csharp
[DefaultValue(DefaultBoolean.Default)]
public DefaultBoolean CrosshairEnabled { get; set; }
vb
<DefaultValue(DefaultBoolean.Default)>
Public Property CrosshairEnabled As DefaultBoolean

Property Value

TypeDefaultDescription
DefaultBooleanDefault

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

|

Available values:

NameDescriptionReturn 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

|

Remarks

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

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

The following image shows the enabled crosshair cursor with the CrosshairOptions.ShowArgumentLabels, CrosshairOptions.ShowValueLabels, CrosshairOptions.ShowArgumentLine and CrosshairOptions.ShowValueLine set to true.

You can also change the content of crosshair labels, via the CrosshairAxisLabelOptions.Pattern and SeriesBase.CrosshairLabelPattern properties.

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

Example

This example shows how to enable the Crosshair Cursor and configure its settings.

The following API members are used:

MemberDescription
WebChartControl.CrosshairEnabledGets or sets the value that specifies whether the Crosshair Cursor is enabled for a chart.
CrosshairOptions.ContentShowModeGets or sets the element that displays the Crosshair’s content.
CrosshairOptions.ShowValueLabelsGets or sets the value that specifies whether to show a value label for a series point the Crosshair Cursor highlights.
CrosshairOptions.ShowValueLineSpecifies whether to show a value line for a series point the Crosshair Cursor highlights.
CrosshairOptions.CrosshairLabelModeSpecifies the value that defines how to show the Crosshair Cursor’s label for a series.
csharp
webChartControl.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.True;
webChartControl.CrosshairOptions.ContentShowMode = CrosshairContentShowMode.Label;
webChartControl.CrosshairOptions.CrosshairLabelMode = CrosshairLabelMode.ShowForNearestSeries;
webChartControl.CrosshairOptions.ShowArgumentLabels = true;
webChartControl.CrosshairOptions.ShowArgumentLine = true;
webChartControl.CrosshairOptions.ShowValueLabels = true;
webChartControl.CrosshairOptions.ShowValueLine = true;
vb
webChartControl.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.True
webChartControl.CrosshairOptions.ContentShowMode = CrosshairContentShowMode.Label
webChartControl.CrosshairOptions.CrosshairLabelMode = CrosshairLabelMode.ShowForNearestSeries
webChartControl.CrosshairOptions.ShowArgumentLabels = true
webChartControl.CrosshairOptions.ShowArgumentLine = true
webChartControl.CrosshairOptions.ShowValueLabels = true
webChartControl.CrosshairOptions.ShowValueLine = true

See Also

WebChartControl Class

WebChartControl Members

DevExpress.XtraCharts.Web Namespace