---
title: Generate Donut Graph API
slug: simple-donut-chart-generation
url: https://apyhub.com/apyhub/service/simple-donut-chart-generation
provider: ApyHub
categories: [Smart Generation]
tags: [donut, chart, generate, graph]
auth: api_key
version: 1.0
service_type: sync
endpoints: 2
atoms: 60
mcp: true
---

# Generate Donut Graph API

Generate donut chart images from a title and labeled data. Returns a binary image or a pre-signed URL for dashboards, reports, and breakdowns.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/simple-donut-chart-generation/download` | What it does Generates a donut chart image from the request body and returns it as binary data. The… | 60 |
| POST | `https://api.eu.apyhub.com/apyhub/simple-donut-chart-generation/link` | What it does Generates a donut chart and returns a pre-signed URL for the generated chart image. Re… | 60 |

## Endpoint reference

### Generate donut chart image

`POST https://api.eu.apyhub.com/apyhub/simple-donut-chart-generation/download` · 60 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `data` | body | array of object | yes |  |
| `data[].color` | body | string | no | 6-character hex color without the leading # symbol. Example: `3B82F6`. |
| `data[].label` | body | string | yes | Example: `Active`. |
| `data[].value` | body | number | yes | Example: `72`. |
| `theme` | body | string | no | Chart theme. One of: light, dark. Default: `light`. Example: `light`. |
| `title` | body | string | yes | Example: `Subscription Status Breakdown`. |
| `slices` | body | array of object | no | Alias for data. Use either data or slices, not both. |
| `slices[].color` | body | string | no | 6-character hex color without the leading # symbol. Example: `3B82F6`. |
| `slices[].label` | body | string | yes | Example: `Active`. |
| `slices[].value` | body | number | yes | Example: `72`. |
| `output` | query | string | no | Example: `subscription-status-donut-chart`. |

#### Quickstart

Create a donut chart image from a title and slice data, then download the generated binary file.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/simple-donut-chart-generation/download?output=subscription-status-donut-chart" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Subscription Status Breakdown",
    "data": [
      { "label": "Active", "value": 72, "color": "10B981" },
      { "label": "Trial", "value": 18, "color": "3B82F6" },
      { "label": "Cancelled", "value": 10, "color": "EF4444" }
    ]
  }'
```

#### What you'll get back

Returns a binary file (`string` with `format: "binary"`), which is the generated donut chart image.

### Generate donut chart link

`POST https://api.eu.apyhub.com/apyhub/simple-donut-chart-generation/link` · 60 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `data` | body | array of object | yes |  |
| `data[].color` | body | string | no | 6-character hex color without the leading # symbol. Example: `3B82F6`. |
| `data[].label` | body | string | yes | Example: `Active`. |
| `data[].value` | body | number | yes | Example: `72`. |
| `theme` | body | string | no | Chart theme. One of: light, dark. Default: `light`. Example: `light`. |
| `title` | body | string | yes | Example: `Subscription Status Breakdown`. |
| `slices` | body | array of object | no | Alias for data. Use either data or slices, not both. |
| `slices[].color` | body | string | no | 6-character hex color without the leading # symbol. Example: `3B82F6`. |
| `slices[].label` | body | string | yes | Example: `Active`. |
| `slices[].value` | body | number | yes | Example: `72`. |
| `output` | query | string | no | Example: `subscription-status-donut-chart`. |

#### Quickstart

Generate a donut chart image link from a title and chart data.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/simple-donut-chart-generation/link?output=subscription-status-donut-chart" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Subscription Status Breakdown",
    "data": [
      { "color": "10B981", "label": "Active", "value": 72 },
      { "color": "3B82F6", "label": "Trial", "value": 18 },
      { "color": "EF4444", "label": "Cancelled", "value": 10 }
    ]
  }'
```

#### What you'll get back

Returns a JSON object with a `data` string field containing a pre-signed URI for the generated chart image.

```json
{
  "data": "https://apyhub-outgoing.s3.eu-west-1.amazonaws.com/mono-go/chart_generator/general/chart_generator_2026-08-07_9f50ff77.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIARJOHWS6LWTUUGYPI%2F20260807%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20260807T130606Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&response-content-disposition=inline&response-content-type=image%2Fpng&X-Amz-Signature=eebbdbf6e5651b9e222d2b4e2da92f0d4ad500057415f364097d98e14fa73563"
}
```

## About

## What it does
Donut Chart Generator creates a donut chart from your data and returns either a downloadable chart image or a pre-signed image link. Send a title, a data array, and an optional theme; each data item can include a label, value, and hex color.

Use `data` to define the chart segments. Each item must include `label` and `value`, and `color` is optional as a 6-character hex string without the `#`. The `theme` can be `light` or `dark`, with `light` as the default. The service also accepts `slices` as a deprecated alias for `data`, so you can keep older integrations working while you migrate.

Choose `POST /download` when you want the generated chart image itself. It returns a binary response suitable for direct file handling. Choose `POST /link` when you want a JSON response containing a `data` field with a pre-signed URL to the generated chart image.

This is useful when you need charts for dashboards, reports, status pages, or automated notifications where the visualization is built from live application data. You control the title and segment labels, so the chart can reflect subscription breakdowns, sales mix, usage tiers, or any other labeled distribution.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/simple-donut-chart-generation
