# ChartCollection Class

> An instance of the ChartCollection class contains all charts in a document represented through objects of the type DataVisualization.ChartFrame. An instance of this class can be obtained with the TextControl.Charts or ServerTextControl.Charts property. The ChartCollection class implements the IEnumerable and the ICollection interfaces.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 18.0
- **Namespace:** `TXTextControl.DataVisualization`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Inherits:** `TXTextControl.FrameBaseCollection`
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DataVisualization > ChartCollection Class
- **1019 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/llms-full.txt

---

### Description

An instance of the ChartCollection class contains all charts in a document represented through objects of the type [DataVisualization.ChartFrame](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartframe/llms-full.txt). An instance of this class can be obtained with the [TextControl.Charts](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/charts-property/llms-full.txt) or [ServerTextControl.Charts](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/charts-property/llms-full.txt) property. The ChartCollection class implements the IEnumerable and the ICollection interfaces.

### Syntax

```csharp
public class ChartCollection : FrameBaseCollection
```

```vbnet
Public Class ChartCollection
    Inherits FrameBaseCollection
```

### Examples

The following example includes the count value from a Chart Collection object in application diagnostics. The created object is then available to the surrounding document workflow.

```csharp
Console.WriteLine($"Count: {chartCollection.Count}");
Console.WriteLine("Chart Collection is ready for use.");
```

```vbnet
Console.WriteLine($"Count: {chartCollection.Count}")
Console.WriteLine("Chart Collection is ready for use.")
```

---

## In This Section

- [ChartCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/add-method/llms-full.txt): Inserts a new chart in a Text Control document.
- [ChartCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/copyto-method/llms-full.txt): Copies the elements of the collection to an array, starting at a particular index.
- [ChartCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/getitem-method/llms-full.txt): Gets a particular chart from the collection.
- [ChartCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/remove-method/llms-full.txt): Removes a chart from a Text Control document.

---

## Nearby

- **Previous:** [BarcodeFrame.SaveMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/barcodeframe/savemode-property/llms-full.txt)
- **Next:** [ChartCollection.Add Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/chartcollection/add-method/llms-full.txt)
