Chart.HitTest Method (Int32, Int32, ChartElementType)
Determines if a chart element of a given type is located at a point defined by given X and Y coordinates.
Assembly: System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)
The X-coordinate value of the point the user clicked on.
The Y-coordinate value of the point the user clicked on.
A flag that determines the chart element type to be tested.
Return ValueType: System.Windows.Forms.DataVisualization.Charting.HitTestResult
A HitTestResult object, which provides information concerning the chart element, if any, that is at the specified location.
Call this method to determine if a chart element of the given type is located at a specified point.
The properties of the HitTestResult object that is returned 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