Hi Ignacio,
In general the hit test for surface series is based on the polygons that are formed by adjacent data points. The data points themselves cannot be hit-tested. For the Grid and Mesh surface series it is possible to relate a surface "segment" with a data point - when a rectangular segment is hit, the chart returns the index of the "left-bottom" data point in the grid. For Triangulated surface the segments are arbitrary triangles and such relation is not possible. For this series type the chart returns a NSurfaceTriangle object that has the indices of the three data points that form the hit triangle.
void OnChartControlMouseDown(object sender, MouseEventArgs e)
{
NHitTestResult result = nChartControl1.HitTest(e.X, e.Y);
NSurfaceTriangle tr = result.Object as NSurfaceTriangle;
if (tr == null)
return;
NTriangulatedSurfaceSeries surface = tr.ParentNode as NTriangulatedSurfaceSeries;
int index1 = tr.DataPointIndex1;
int index2 = tr.DataPointIndex2;
int index3 = tr.DataPointIndex3;
}
It is possible to implement "exact" hit testing for all types of surface series - that is in case you need the exact scale coordinates of the clicked point on the surface. We have such examples for Grid and Triangulated surface series, please contact Nevron support if you need them.
Best Regards,
Nevron Support Team