Checks whether a point with the particular coordinates is contained inside a chart element.
Namespace: MindFusion.Charting.WinForms
Assembly: MindFusion.Charting.WinForms
C#
![]() |
---|
public Object HitTest ( |
Visual Basic
![]() |
---|
Public Function HitTest( _ |
The X - coordinate of the element to get.
The index of the element; -1 if none;
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.