ChartHitInfo.HitPoint Property

Gets the test point.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.1.dll

Declaration

public Point HitPoint { get; }
Public ReadOnly Property HitPoint As Point

Property Value

Type Description
Point

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

Remarks

Hit information for a point is calculated via the ChartControl.CalcHitInfo method. This method takes the test point as the parameter. The test point is assigned to the HitPoint property of the returned ChartHitInfo object.

Examples

The following examples demonstrates how to handle the ChartControl.MouseMove event and calculate the hit information for the point which the mouse pointer is currently hovering over. Then, the name of the chart element located under the mouse pointer is shown within the form caption.

using System.Windows.Forms;
using DevExpress.XtraCharts;
// ...

private void chartControl1_MouseMove(object sender, MouseEventArgs e) {
    ChartHitInfo hi = chartControl1.CalcHitInfo(new System.Drawing.Point(e.X, e.Y));
    this.Text = hi.HitTest.ToString();
}
See Also