# ChartCollection Class

> ChartCollection class in the TX Sheet Control .NET API: Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Inherits:** `TXTextControl.TXSheetControl.Server.DocumentObject`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > ChartCollection Class
- **986 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/llms-full.txt

---

Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.

### Syntax

```csharp
public class ChartCollection
```

### Members

#### Methods

| Method | Description |
|---|---|
| [AddAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/addasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [AtAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/atasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [GetAllAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getallasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [GetAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [GetByIdAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getbyidasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [GetCountAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getcountasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [RemoveAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/removeasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |

### Examples

Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateChartCollectionReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Range("A1:B5").SetValuesAsync(new object?[][]
    {
        ["Region", "Revenue"], ["North", 42000], ["South", 38500], ["East", 31200], ["West", 44900]
    });

    var chart = await sheet.Charts.AddAsync(new { type = "column", title = "Revenue by region", dataRange = "A1:B5", anchor = new { cell = "D2" } });
    var chartCollection = sheet.Charts;
    return await control.SaveAsync(StreamType.PDF);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Charts and Sparklines](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/charts/llms-full.txt)

---

## In This Section

- [ChartCollection.AddAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/addasync-method/llms-full.txt): ChartCollection.AddAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [ChartCollection.AtAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/atasync-method/llms-full.txt): ChartCollection.AtAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [ChartCollection.GetAllAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getallasync-method/llms-full.txt): ChartCollection.GetAllAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [ChartCollection.GetAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getasync-method/llms-full.txt): ChartCollection.GetAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [ChartCollection.GetByIdAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getbyidasync-method/llms-full.txt): ChartCollection.GetByIdAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [ChartCollection.GetCountAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/getcountasync-method/llms-full.txt): ChartCollection.GetCountAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [ChartCollection.RemoveAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/removeasync-method/llms-full.txt): ChartCollection.RemoveAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.

---

## Nearby

- **Previous:** [Chart.UpdateAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chart/updateasync-method/llms-full.txt)
- **Next:** [ChartCollection.AddAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/chartcollection/addasync-method/llms-full.txt)
