# Loading Data from a File

## Content



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](/componentone/api/win/online-chart3d/dotnet-framework-api/C1.Win.C1Chart3D.4.8/C1.Win.C1Chart3D.Chart3DData.LoadDataFromFile.html) method can be used to allocate and load data from a file. The following example loads the data from a .dat file:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
' Load the data from a file MMF95.DAT
C1Chart3D1.ChartGroups(0).ChartData.LoadDataFromFile("mmf95.dat")
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
// Load the data from a file MMF95.DAT
C1Chart3D1.ChartGroups[0].ChartData.LoadDataFromFile("mmf95.dat");
```

DOC-DETAILS-TAG-CLOSE

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](/componentone/docs/win/online-chart3d/3dchartfundamentals/3dchartdatalayouts) 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

[Grid File Format](/componentone/docs/win/online-chart3d/3ddata/loadingdatafromafile/gridfileformat)

[Irregular Grid Format](/componentone/docs/win/online-chart3d/3ddata/loadingdatafromafile/irregulargridformat)

[Point File Format](/componentone/docs/win/online-chart3d/3ddata/loadingdatafromafile/pointfileformat)