ComponentOne 3D Chart for WinForms
3D Data / Loading Data from a File
In This Topic
    Loading Data from a File
    In This Topic

    A common task in any C1Chart3D program is to load the chart data (called a dataset) from a file into a format that the chart can use.

    The Chart3DData's LoadDataFromFile method can be used to allocate and load data from a file. The following example loads the data from a .dat file:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    ' Load the data from a file MMF95.DAT
    C1Chart3D1.ChartGroups(0).ChartData.LoadDataFromFile("mmf95.dat")
    

    To write code in C#

    C#
    Copy Code
    // Load the data from a file MMF95.DAT
    C1Chart3D1.ChartGroups[0].ChartData.LoadDataFromFile("mmf95.dat");
    

    In order for C1Chart3D to allocate and load the data from a file, it must be in one of three basic layouts: Grid, Irregular Grid, or Point. Use the Grid format for Surface and Bar charts when the X-coordinates of each point and the Y-coordinates of each point are always the same distance apart. Use the Irregular Grid format for Surface and Bar charts when the X-coordinates of each point or the Y-coordinates of each point are not the same distance apart. Use the Point format for multiple series of points in scatter plots.

    See 3D Chart Data Layouts for more information on Grid, Irregular Grid, and Point layout.

    The following topics provide example formats for the Grid, Irregular Grid, and Point data layout.

    See Also