Modifica

Condividi tramite


HitTestResult Class

Definition

Represents the results of a hit test.

public ref class HitTestResult
public class HitTestResult
type HitTestResult = class
Public Class HitTestResult
Inheritance
HitTestResult

Remarks

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.

Constructors

HitTestResult()

Initializes a new instance of the HitTestResult class.

Properties

Axis

Gets 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.

ChartArea

Gets 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.

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.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to