Chart::HitTest Method
Determines the chart element, if any, that is located at a point defined by the given X and Y coordinates.
Assembly: System.Web.DataVisualization (in System.Web.DataVisualization.dll)
| Name | Description | |
|---|---|---|
![]() | HitTest(Int32, Int32) | Determines the chart element, if any, that is located at a point defined by the given X and Y coordinates. |
![]() | HitTest(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. |
![]() | HitTest(Int32, Int32, Boolean, array<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. |
![]() | HitTest(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.
