---
Product: Aspose.Cells
Platform: typescript
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/typescript/chart
---

# Chart

## Overview

`Chart` is a class in Aspose.Cells FOSS for TypeScript.

Chart.setPositionWithOffset lets you position a chart using absolute pixel offsets and explicit height and width values.

This class declares 7 methods for Chart objects in TypeScript programs.
Available methods include: `constructor`, `setDataRange`, `setLegendPosition`, `setPosition`, `setPositionWithOffset`, `setTitle`, `setWorksheet`.
Public members are accessible to any TypeScript application after installing the Aspose.Cells FOSS for TypeScript package.
Properties: `categoryAxisPosition`, `chartType`, `dataIsVertical`, `dataRange`, `fromCol`, `fromColOff`, and 23 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `chartType` | `: ChartType` | Read/Write | Gets or sets the chart type. |
| `title` | `: string` | Read/Write | Gets or sets the title. |
| `series` | `: ChartSeries[]` | Read/Write | Gets or sets the series. |
| `legendPosition` | `: "left" \| "right" \| "top" \| "bottom"` | Read/Write | Gets or sets the legend position. |
| `categoryAxisPosition` | `: "left" \| "right" \| "top" \| "bottom"` | Read/Write | Gets or sets the category axis position. |
| `valueAxisPosition` | `: "left" \| "right" \| "top" \| "bottom"` | Read/Write | Gets or sets the value axis position. |
| `plotArea` | `: { x: number; y: number; width: number; height: number }` | Read/Write | Gets or sets the plot area. |
| `x` | `: number` | Read | Gets the x. |
| `y` | `: number` | Read | Gets the y. |
| `width` | `: number` | Read | Gets the width. |
| `height` | `: number` | Read | Gets the height. |
| `fromRow` | `: number` | Read/Write | Gets or sets the from row. |
| `fromCol` | `: number` | Read/Write | Gets or sets the from col. |
| `toRow` | `: number` | Read/Write | Gets or sets the to row. |
| `toCol` | `: number` | Read/Write | Gets or sets the to col. |
| `fromRowOff` | `: number` | Read/Write | Gets or sets the from row off. |
| `fromColOff` | `: number` | Read/Write | Gets or sets the from col off. |
| `toRowOff` | `: number` | Read/Write | Gets or sets the to row off. |
| `toColOff` | `: number` | Read/Write | Gets or sets the to col off. |
| `originalX` | `: number` | Read/Write | Gets or sets the original x. |
| `originalY` | `: number` | Read/Write | Gets or sets the original y. |
| `sheetIndex` | `: number` | Read/Write | Gets or sets the sheet index. |
| `type` | `: string` | Read/Write | Gets or sets the type. |
| `name` | `: string` | Read/Write | Gets or sets the name. |
| `originalChartXml` | `: string` | Read/Write | Gets or sets the original chart xml. |
| `originalStyleXml` | `: string` | Read/Write | Gets or sets the original style xml. |
| `originalColorsXml` | `: string` | Read/Write | Gets or sets the original colors xml. |
| `x` | `: number` | Read/Write | Gets or sets the x. |
| `y` | `: number` | Read/Write | Gets or sets the y. |
| `width` | `: number` | Read/Write | Gets or sets the width. |
| `height` | `: number` | Read/Write | Gets or sets the height. |
| `dataRange` | `: string` | Read/Write | Gets or sets the data range. |
| `dataIsVertical` | `: boolean` | Read/Write | Gets or sets the data is vertical. |

## Methods

| Signature | Description |
|-----------|-------------|
| `constructor(type: ChartType, sheetIndex: number)` | Calls constructor(type, sheetIndex) on this Chart instance. |
| `setPosition(topRow: number, leftColumn: number, bottomRow: number, rightColumn: number)` → `Chart` | Sets the position value. |
| `setPositionWithOffset(topRow: number, top: number, leftColumn: number, left: number, height: number, width: number)` → `Chart` | Sets the position with offset value. |
| `setDataRange(dataRange: string, isVertical: boolean)` → `Chart` | Sets the data range value. |
| `setWorksheet(worksheet: Worksheet)` | Sets the worksheet value. |
| `setTitle(title: string)` → `Chart` | Sets the title value. |
| `setLegendPosition(position: "left" \| "right" \| "top" \| "bottom")` → `Chart` | Sets the legend position value. |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)