---
title: Chart data
project: OpenReports
version: 1.0
section: reference
language: en
license: MIT
url: https://totaljs.es/docs/openreports/1-0/reference/api-chart/
updated: 2026-11-19T07:46:46.798Z
---

# Chart data

> POST /reports/ with "chart": true returns the chart data of a report.

Returns the data of a report as chart series. The report needs [chart settings](../../guides/chart-settings/).

## Request

```bash
curl -X POST -H "x-token: YOUR_TOKEN" -H "Content-Type: application/json" \
  -d '{"id":"JapNSY1c161f","chart":true}' \
  http://localhost:8000/reports/
```

You can add `filter` as in [Load a report](../api-load-report/). If the report has no chart settings, you get rows instead.

## Response without series

One series, named after the report, with one point for each row: `x` from the X axis field and `y` from the Y axis field.

```json
[
	{
		"id": "JapNSY1c161f",
		"name": "Sales by product",
		"icon": "ti ti-chart-pie",
		"color": "#4285F4",
		"data": [
			{ "x": "Office chair", "y": 596 },
			{ "x": "Desk lamp", "y": 209.3 },
			{ "x": "Monitor stand", "y": 159.6 },
			{ "x": "Notebook", "y": 97.5 }
		]
	}
]
```

## Response with series

With **Series for**, you get one series for each value of that field. Its `name` is the value.

```json
[
	{
		"id": "JapNIj1uE61f_3275293922",
		"name": "Slovakia",
		"icon": "",
		"color": "",
		"data": [
			{ "x": "Desk lamp", "y": 89.7 },
			{ "x": "Notebook", "y": 50 }
		]
	},
	{
		"id": "JapNIj1uE61f_2112320571",
		"name": "France",
		"icon": "",
		"color": "",
		"data": [
			{ "x": "Desk lamp", "y": 29.9 },
			{ "x": "Monitor stand", "y": 39.9 }
		]
	}
]
```
