Skip to main content

ChartControl.RuntimeHitTesting Property

Specifies whether or not hit-testing is enabled for a Chart control.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v23.2.UI.dll

NuGet Package: DevExpress.Win.Charts

Declaration

public bool RuntimeHitTesting { get; set; }

Property Value

Type Description
Boolean

true if a chart provides hit information at runtime; otherwise, false.

Remarks

The default RuntimeHitTesting property value is false, which means that hit-testing is disabled at runtime. This is done to accelerate chart rendering.

Set the RuntimeHitTesting option to true if you want to use the ChartControl.CalcHitInfo method to get information on clicks within the chart.

Refer to Hit Information for more information.

Note

  • If you handle the ChartControl.ObjectHotTracked event, it will be raised and information on hit-testing will be collected regardless of the current RuntimeHitTesting property value.
  • When the RuntimeHitTesting property is enabled, the SeriesPoint object can be inaccessible when hovering over the LineSeriesView at runtime. To resolve this issue, make sure the line point markers are visible (set the LineSeriesView.MarkerVisibility property to true).

Example

To enable the RuntimeHitTesting property at runtime, turn it on during a chart’s initialization. You can do this in the Form’s constructor after the components’ initialization or in the Form’s Load event handler.

private void Form_Load(object sender, EventArgs e) {
    chartControl.RuntimeHitTesting = true;
    //...
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the RuntimeHitTesting 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