About this endpoint
What it does
Generates a donut chart image from the request body and returns it as binary data. The chart is configured with a title, a theme, and an array of labeled slice values.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| title | String | Yes | Chart title. Must be at least 1 character. |
| data | Object Array | Yes | Chart slices. Provide at least 1 item. Each item contains the slice label and value, and may include an optional 6-character hex color without the leading #. |
| data[].label | String | Yes | Slice label. |
| data[].value | Number | Yes | Slice value. Must be greater than or equal to 0. |
| data[].color | String | No | Optional slice color as a 6-character hex value without the leading #. Pattern: ^[A-Fa-f0-9]{6}$. |
| theme | ENUM | No | Chart theme. Allowed values: light, dark. Default: light. |
| slices | Object Array | No | Alias for data. Deprecated. Use either data or slices, not both. Each item has the same shape as data[]. |
| slices[].label | String | Yes | Slice label. |
| slices[].value | Number | Yes | Slice value. Must be greater than or equal to 0. |
| slices[].color | String | No | Optional slice color as a 6-character hex value without the leading #. Pattern: ^[A-Fa-f0-9]{6}$. |
Response
Returns a binary response containing the generated chart image. The output schema is a string with binary format, so the success response body is the image itself rather than a JSON object.