Skip to main content

ChartControl.CalcHitInfo(Point) Method

Returns information on the chart elements located at the specified point.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v14.2.dll

#Declaration

public ChartHitInfo CalcHitInfo(
    Point point
)

#Parameters

Name Type Description
point Point

A Point structure which specifies the test point coordinates relative to the chart's top-left corner.

#Returns

Type Description
ChartHitInfo

A ChartHitInfo object, which contains information about the chart elements located at the test point.

#Remarks

Use the CalcHitInfo method to determine which element is located at the specified point. For instance, this can be used when handling the chart's MouseDown event to determine which element was clicked. In such cases, pass the current mouse pointer's coordinates as the method's parameter.

#Examples

This example demonstrates how to calculate the hit information for the chart element over which the mouse pointer is hovering.

To accomplish this, handle the ChartControl.MouseMove event, obtain the current chart element via the ChartControl.CalcHitInfo method, and if the element is not null (Nothing in Visual Basic), display its information.

See Also