Export (0) Print
Expand All

HitTestResult Class

Represents the results of a hit test.

System.Object
  System.Web.UI.DataVisualization.Charting.HitTestResult

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

public class HitTestResult

The HitTestResult type exposes the following members.

  NameDescription
Public methodHitTestResultInitializes a new instance of the HitTestResult class.
Top

  NameDescription
Public propertyAxisGets or sets the Axis object that may be associated with a chart element returned by a hit test. The presence of an associated Axis object depends on whether a chart element was detected at the given location, and the type of chart element returned.
Public propertyChartAreaGets or sets the ChartArea object that may be associated with a chart element returned by a hit test. The presence of a ChartArea object depends on whether a chart element was detected at the given location, and the type of chart element returned.
Public propertyChartElementTypeGets or sets the type of chart element, if any, returned by a hit test.
Public propertyObjectGets or sets the object, if any, returned by a hit test.
Public propertyPointIndexGets or sets the index of a data point, if any, returned by a hit test.
Public propertySeriesGets or sets the associated series of a data point, if any, returned by a hit test.
Public propertySubObjectGets the sub-object, if any, returned by a hit test.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

.NET Framework

Supported in: 4.6, 4.5, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft