Chart.HitTest Method (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.
Assembly: System.Web.DataVisualization (in System.Web.DataVisualization.dll)
public HitTestResult HitTest( int x, int y, bool ignoreTransparent, params ChartElementType requestedElement )
The X-coordinate for the specified data point.
The Y-coordinate for the specified data point.
A flag that indicates that transparent elements should be ignored.
An array of ChartElementType objects that specify the types to test for, in order to filter the result. If omitted, checking for element types will be ignored and all element types will be valid.
Return ValueType: System.Web.UI.DataVisualization.Charting.HitTestResult
An array of T:System.Web.UI.DataVisualization.Charting.HitTestResult objects that provides information about the chart element, if any, found at the specified location. The array contains at least one element, which can be Nothing. The objects in the result are sorted from the top to the bottom of different layers of control.
Call this method to determine the gauge element, if any, which is located at a specified point. This method is often used in some mouse-related event, for example, MouseDown, to determine which gauge 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.
Available since 4.0