# ChartHandle Class

> ChartHandle class in the TX Sheet Control JavaScript API for the browser: A worksheet-bound chart handle. Includes the syntax and a JavaScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > ChartHandle Class
- **882 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/llms-full.txt

---

A worksheet-bound chart handle. Data references are resolved by the workbook calculation engine.

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

ES module import: `import { ChartHandle } from '@txtextcontrol/tx-sheet-control';`.

### Constructor

```javascript
new ChartHandle(sheet, id)
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `sheet` | `Worksheet` | No | Value matching sheet's declared type and the owning object's validation rules. |
| `id` | `string` | No | Stable identity in the owning document/collection. |

Returns: `Chart`.

### Members

#### Properties

| Property | Description |
|---|---|
| [data](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/data-property/llms-full.txt) | The data value of ChartHandle. |
| [id](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/id-property/llms-full.txt) | The id value of ChartHandle. |
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/sheet-property/llms-full.txt) | The sheet value of ChartHandle. |
| [snapshot](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/snapshot-property/llms-full.txt) | The snapshot value of ChartHandle. |
| [title](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/title-property/llms-full.txt) | The title value of ChartHandle. |

#### Methods

| Method | Description |
|---|---|
| [moveTo](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/moveto-method/llms-full.txt) | Move the chart to a cell anchor. |
| [remove](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/remove-method/llms-full.txt) | Remove the chart. |
| [resize](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/resize-method/llms-full.txt) | Set chart width/height. |
| [update](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/update-method/llms-full.txt) | Patch chart configuration. |

### 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.

```javascript
function createChartHandleReport(book) {
    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

- [JavaScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/llms-full.txt)
- [Charts and Sparklines](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/charts/llms-full.txt)

---

## In This Section

- [ChartHandle.data Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/data-property/llms-full.txt): ChartHandle.data property in the TX Sheet Control JavaScript API for the browser, with its type ChartSeriesData[] and a JavaScript example.
- [ChartHandle.id Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/id-property/llms-full.txt): ChartHandle.id property in the TX Sheet Control JavaScript API for the browser, with its type string and a JavaScript example.
- [ChartHandle.moveTo Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/moveto-method/llms-full.txt): ChartHandle.moveTo method in the TX Sheet Control JavaScript API for the browser, with the return type Chart and a JavaScript example.
- [ChartHandle.remove Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/remove-method/llms-full.txt): ChartHandle.remove method in the TX Sheet Control JavaScript API for the browser: Remove the chart. Includes the syntax and a JavaScript example.
- [ChartHandle.resize Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/resize-method/llms-full.txt): ChartHandle.resize method in the TX Sheet Control JavaScript API for the browser: Set chart width/height. Includes the syntax and a JavaScript example.
- [ChartHandle.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/sheet-property/llms-full.txt): ChartHandle.sheet property in the TX Sheet Control JavaScript API for the browser, with its type Worksheet and a JavaScript example.
- [ChartHandle.snapshot Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/snapshot-property/llms-full.txt): ChartHandle.snapshot property in the TX Sheet Control JavaScript API for the browser, with its type ChartSnapshot and a JavaScript example.
- [ChartHandle.title Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/title-property/llms-full.txt): ChartHandle.title property in the TX Sheet Control JavaScript API for the browser, with its type string and a JavaScript example.
- [ChartHandle.update Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/update-method/llms-full.txt): ChartHandle.update method in the TX Sheet Control JavaScript API for the browser: Patch chart configuration. Includes the syntax and a JavaScript example.

---

## Nearby

- **Previous:** [ChartCollection.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/chartcollection/sheet-property/llms-full.txt)
- **Next:** [ChartHandle.data Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/charthandle/data-property/llms-full.txt)
