HitTestResult Class
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Represents the results of a hit test.
Assembly: System.Web.DataVisualization (in System.Web.DataVisualization.dll)
Name | Description | |
---|---|---|
![]() | HitTestResult() | Initializes a new instance of the HitTestResult class. |
Name | Description | |
---|---|---|
![]() | Axis | |
![]() | ChartArea | |
![]() | ChartElementType | Gets or sets the type of chart element, if any, returned by a hit test. |
![]() | Object | Gets or sets the object, if any, returned by a hit test. |
![]() | PointIndex | Gets or sets the index of a data point, if any, returned by a hit test. |
![]() | Series | Gets or sets the associated series of a data point, if any, returned by a hit test. |
![]() | SubObject | Gets the sub-object, if any, returned by a hit test. |
Name | Description | |
---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
The HitTestResult class represents the results of a hit test, and is exposed as the return object from a HitTest method call.
A hit test checks a specified point in the chart to determine if a chart element is located at that point. If a chart element is detected, the HitTestResult class is used to obtain information about that chart element.
If a chart element is found, the Object property returns a reference to the chart element; the only exception to this being DataPoint objects, in which case the return value of this property is null.
If a data point is located, you can use the PointIndex property to get the index of that data point; that is, the zero-based index of the point in the DataPointCollection. Use the Series property to get the associated Series object for that data point.
The ChartArea and Axis properties are used to get the associated chart area and axis of the chart element—if any—returned by the hit test. Note that these properties may be null if the returned chart element does not have an associated chart area or axis.
Use the ChartElementType property to determine the type of the chart element returned by a hit test.
Available since 4.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.