ComponentOne 3D Chart for WinForms
3D Chart End-User Interaction / Returning Coordinate Values / Converting Data Coordinates to Pixel Coordinates
In This Topic
    Converting Data Coordinates to Pixel Coordinates
    In This Topic

    To convert from data coordinates to screen pixel coordinates, call the DataCoordToCoord method. For example, the following code obtains the pixel coordinates corresponding to the data coordinates (5.1, 10.2, 8.4):

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim PixelX, PixelY As Integer
    C1Chart3D1.ChartGroups(0).ChartData. _DataCoordToCoord(5.1, 10.2, 8.4, PixelX, PixelY)
    ' PixelX and PixelY now contain the pixel coordinate value.
    

    To write code in C#

    C#
    Copy Code
    int PixelX=0, PixelY=0;
    C1Chart3D1.ChartGroups[0].ChartData.
    DataCoordToCoord(5.1, 10.2, 8.4, ref PixelX, ref PixelY);
    // PixelX and PixelY now contain the pixel coordinate value.
    

    If the data coordinate is out of the visible range of the chart, this method returns false.

    See Also