# ChartSeries.dataLabels Property

> ChartSeries.dataLabels property in the TX Sheet Control TypeScript API for the browser, with its type ChartSeries['dataLabels'] and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Property
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > ChartSeries > ChartSeries.dataLabels Property
- **762 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/chartseries/datalabels-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/chartseries/datalabels-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/chartseries/datalabels-property/llms-full.txt

---

Formats the original series values displayed on chart marks, including percentage-stacked charts. Labels do not change the numeric series.

Owner: [ChartSeries](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/chartseries/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

### Syntax

```typescript
dataLabels?: ChartSeries['dataLabels']
```

### Settings

`numberFormatCode` is an Excel numeric format of at most 255 characters. `color` is a six-digit RGB caption color; `fontSize` uses points (1–200); `bold` is a Boolean. `position` is `center`, `insideEnd` or `outsideEnd`. Enable chart `elements.dataLabels` to display captions. Omitted fields inherit chart defaults. A 100% stacked chart positions bars by normalized values but displays original values with this format.

### Examples

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

function configureReport(book: Workbook) {
    const sheet = book.sheets.at(0);
    const chart = sheet.charts.add({
        type: 'bar-100', title: 'Event budget',
        series: [
            { name: 'Income', values: { values: [1936, 1831] }, categories: { values: ['Estimated', 'Actual'] },
              color: '#ff4500', dataLabels: { numberFormatCode: '"$"#,##0', color: '#ffffff', bold: true, position: 'center' } },
            { name: 'Expenses', values: { values: [882, 333] }, categories: { values: ['Estimated', 'Actual'] },
              color: '#ffb499', dataLabels: { numberFormatCode: '"$"#,##0', position: 'center' } }
        ], anchor: { cell: 'E2' }, size: { width: 520, height: 320 }
    });
    chart.update({
        elements: { dataLabels: true, gridlines: false },
        presentation: {
            backgroundColor: null, borderColor: null,
            plotLayout: { x: 0.12, y: 0.24, width: 0.85, height: 0.68 },
            categoryAxis: { visible: true, lineVisible: false, labelRotation: -90 },
            valueAxis: { visible: false }, gapWidth: 50
        }
    });
    return chart;
}
```

---

## Nearby

- **Previous:** [ChartSeries.xValues Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/chartseries/xvalues-property/llms-full.txt)
- **Next:** [ChartSeriesData Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/chartseriesdata/llms-full.txt)
