MindFusion WinForms Programmer's Guide
Chart.HitTest Method
See Also
 





Checks whether a point with the particular coordinates is contained inside a chart element.

Namespace: MindFusion.Charting.WinForms
Assembly: MindFusion.Charting.WinForms

 Syntax

C#  Copy Code

public Object HitTest (
    int x,
    int y
)

Visual Basic  Copy Code

Public Function HitTest( _
    x As Integer, _
    y As Integer _
) As Object

 Parameters

x

The X - coordinate of the element to get.

y
The Y - coordinate of the element to get.

 Return Value

The index of the element; -1 if none;

 Remarks

Call this method inside event handlers for user interaction with the mouse. The mouse coordinates are retrieved from the event data.

The Chart control overrides HitTest to return a specific chart element. Cast the result to Bar, Line, Scatter, Bubble, PiePiece or RadarPiece according to the chart type you are using. All HitTest methods may return null so always check.

 See Also

Chart Members
Chart Class
MindFusion.Charting.WinForms Namespace