ComponentOne 3D Chart for WinForms
3D Chart End-User Interaction / Returning Coordinate Values / Determining the Closest Data Point
In This Topic
    Determining the Closest Data Point
    In This Topic

    To determine the closest data point to a set of pixel coordinates, call CoordToDataIndex:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim Row, Column As Integer
    
    C1Chart3D1.ChartGroups(0).ChartData.CoordToDataIndex( 225, 92, Column, Row)
    ' CoordToDataIndex returns the row and column of the closest data point.
    

    To write code in C#

    C#
    Copy Code
    int Row=0, Column=0;
    
    C1Chart3D1.ChartGroups[0].ChartData.CoordToDataIndex(225, 92, ref Column, ref Row);
    // CoordToDataIndex returns the row and column of the closest data point.
    
    See Also