Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Hit-Testing

Hit-testing allows you to recognize which element is located at the specified screen coordinates. For instance, you may have to determine which chart element has been clicked or double-clicked by an end-user.

ChartHitTesting

To obtain this information, use the ChartControl.CalcHitInfo method. This method accepts a test dependency object and returns the hit info object, containing information about the test object’s position within a chart.

All information about hit-testing is represented by the ChartHitInfo object, which contains information about a specific point within a chart.

The ChartHitInfo class properties can be grouped into two categories:

  • The properties that indicate whether the test point resides over a particular view element. For instance, the ChartHitInfoBase.InAxis property indicates whether the test point is over the axis;
  • The properties identifying the topmost visual element, which contains the test point (e.g. ChartHitInfoBase.Axis).

 

If you want to learn how to utilize this feature with DXCharts, see the following tutorials:

See Also