Skip to main content

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.v23.2.Web.dll

NuGet Package: DevExpress.Web.Visualization

Declaration

[DefaultValue(DefaultBoolean.Default)]
public DefaultBoolean CrosshairEnabled { get; set; }

Property Value

Type Default Description
DefaultBoolean Default

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:

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

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.

CrosshairEnabledForChart

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:

Member Description
WebChartControl.CrosshairEnabled Gets or sets the value that specifies whether the Crosshair Cursor is enabled for a chart.
CrosshairOptions.ContentShowMode Gets or sets the element that displays the Crosshair’s content.
CrosshairOptions.ShowValueLabels Gets or sets the value that specifies whether to show a value label for a series point the Crosshair Cursor highlights.
CrosshairOptions.ShowValueLine Specifies whether to show a value line for a series point the Crosshair Cursor highlights.
CrosshairOptions.CrosshairLabelMode Specifies the value that defines how to show the Crosshair Cursor’s label for a series.
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