apyhub
IMAGE PROCESSING · SMART GENERATION

Donut Chart Generator

What it does

Donut Chart Generator creates donut chart images from a title, chart data, and an optional theme. Send a title and a data array of labeled values; each item can also include a 6-character hex color without the # prefix. You can set theme to light or dark, and the deprecated slices field is still accepted as an alias for data, but not both in the same request.

Use POST /download when you want the rendered chart as a binary image. Use POST /link when you want a pre-signed URL back in a JSON response. In both cases, the service is built around the same chart definition, so you can generate the image once and reuse the link in emails, dashboards, reports, or internal admin tools.

This is a good fit for visualizing category splits, subscription status, survey results, or other part-to-whole metrics. For example, you can turn Active, Trial, and Cancelled counts into a chart with a clear title and custom slice colors, then embed the result wherever your application needs a compact summary graphic.

▣ ENDPOINT 01 / 02
POST
Generate donut chart image
https://api.eu.apyverse.com/apyhub/generate-donut-chart/download

QUICKSTART

GUIDE

Quickstart

Generate a donut chart image from a simple title and data series.

curl -X POST "https://api.eu.apyverse.com/apyhub/generate-donut-chart/download" \
  -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 binary file response (string with format: binary), which is the generated donut chart image.

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
data*
data-1*
6-character hex color without the leading # symbol.
Chart theme.
slices
Alias for data. Use either data or slices, not both.

About this endpoint

What it does

Generates a donut chart image from the chart configuration sent in the request body and returns the image as binary data.

Request Body

ParameterTypeMandatoryDescription
titleStringYesChart title. Minimum length 1.
themeENUMNoChart theme. Allowed values: light, dark. Default: light.
dataObject ArrayYesChart data points to render. At least 1 item required.
data[].colorStringNo6-character hex color without the leading # symbol. Pattern: ^[A-Fa-f0-9]{6}$.
data[].labelStringYesSlice label.
data[].valueNumberYesSlice value. Must be 0 or greater.
slicesObject ArrayNoAlias for data. Deprecated. Use either data or slices, not both. At least 1 item required.
slices[].colorStringNo6-character hex color without the leading # symbol. Pattern: ^[A-Fa-f0-9]{6}$.
slices[].labelStringYesSlice label.
slices[].valueNumberYesSlice value. Must be 0 or greater.

Response

Returns a binary file response containing the generated chart image.

ParameterTypeMandatoryDescription
binaryStringYesBinary image data returned by the endpoint.

Query parameters

Name
Type
Description
outputOPTIONAL
string

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.