Chart.HitTest Method

.NET Framework (current version)
 

Determines the chart element, if any, that is located at a point defined by the given X and Y coordinates.

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

NameDescription
System_CAPS_pubmethodHitTest(Int32, Int32)

Determines the chart element, if any, that is located at a point defined by the given X and Y coordinates.

System_CAPS_pubmethodHitTest(Int32, Int32, Boolean)

Determines the chart element, if any, that is located at a point defined by given X and Y coordinates. Transparent elements can optionally be ignored.

System_CAPS_pubmethodHitTest(Int32, Int32, Boolean, ChartElementType[])

Determines whether a chart element that is one of the specified types is located at a point defined by the given X and Y coordinates.

System_CAPS_pubmethodHitTest(Int32, Int32, ChartElementType)

Determines whether a chart element of a given type is located at a point defined by the given X and Y coordinates.

Call this method to determine the chart element, if any, that is located at a specified point.

This method is often used in some mouse-related event—for example, MouseDown—to determine which chart element the end-user clicked. The X and Y mouse coordinates obtained from the event parameters are then used for the x and y parameter values of this method call.

The properties of the returned HitTestResult object can then be used to determine which chart element was clicked; the HitTestResult object also provides an instance of the actual object selected, if any.

Return to top
Show: