# ChartCollection Class

> ChartCollection class in the TX Sheet Control TypeScript API for Node.js, with 2 properties and 5 methods and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > ChartCollection Class
- **825 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/llms-full.txt

---

Public class for ChartCollection.

Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

### Constructor

```typescript
new ChartCollection(sheet: Worksheet): ChartCollection
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `sheet` | `Worksheet` | No | Value matching sheet's declared type and the owning object's validation rules. |

Returns: `ChartCollection`.

### Members

#### Properties

| Property | Description |
|---|---|
| [count](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/count-property/llms-full.txt) | The count value of ChartCollection. |
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/sheet-property/llms-full.txt) | The sheet value of ChartCollection. |

#### Methods

| Method | Description |
|---|---|
| [add](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/add-method/llms-full.txt) | Create a chart from cell data or series. |
| [at](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/at-method/llms-full.txt) | Find by zero-based index. |
| [get](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/get-method/llms-full.txt) | Find by exact title; throw when absent or ambiguous. |
| [getById](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/getbyid-method/llms-full.txt) | Find by chart identity. |
| [remove](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/remove-method/llms-full.txt) | Remove a chart handle or ID. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```typescript
import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function createChartCollectionReport(control: ServerSheetControl) {
    const book = control.workbook;
    const sheet = book.sheets.at(0);
    sheet.range('A1:B5').setValues([
        ['Region', 'Revenue'],
        ['North', 42000],
        ['South', 38500],
        ['East', 31200],
        ['West', 44900],
    ]);

    const chart = sheet.charts.add({
        type: 'column',
        title: 'Revenue by region',
        dataRange: 'A1:B5',
        anchor: { cell: 'D2' },
        size: { width: 480, height: 240 },
    });

    return sheet;
}
```

### See Also

- [TypeScript Node.js Server API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/llms-full.txt)
- [Charts and Sparklines](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/charts/llms-full.txt)

---

## In This Section

- [ChartCollection.add Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/add-method/llms-full.txt): ChartCollection.add method in the Node.js TypeScript API: Create a chart from cell data or series. Includes the syntax and a TypeScript example.
- [ChartCollection.at Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/at-method/llms-full.txt): ChartCollection.at method in the TX Sheet Control TypeScript API for Node.js: Find by zero-based index. Includes the syntax and a TypeScript example.
- [ChartCollection.count Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/count-property/llms-full.txt): ChartCollection.count property in the TX Sheet Control TypeScript API for Node.js, with its type number and a TypeScript example.
- [ChartCollection.get Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/get-method/llms-full.txt): ChartCollection.get method in the TX Sheet Control TypeScript API for Node.js: Find by exact title; throw when absent or ambiguous.
- [ChartCollection.getById Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/getbyid-method/llms-full.txt): ChartCollection.getById method in the TX Sheet Control TypeScript API for Node.js: Find by chart identity. Includes the syntax and a TypeScript example.
- [ChartCollection.remove Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/remove-method/llms-full.txt): ChartCollection.remove method in the TX Sheet Control TypeScript API for Node.js: Remove a chart handle or ID. Includes the syntax and a TypeScript example.
- [ChartCollection.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/sheet-property/llms-full.txt): ChartCollection.sheet property in the TX Sheet Control TypeScript API for Node.js, with its type Worksheet and a TypeScript example.

---

## Nearby

- **Previous:** [ChartAppearance.presentation Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartappearance/presentation-property/llms-full.txt)
- **Next:** [ChartCollection.add Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/chartcollection/add-method/llms-full.txt)
