About this endpoint
What it does
Generates a pie chart image from the supplied chart data and returns the image as binary content. The request body defines the chart title, slices, theme, and optional rendering options.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object Array | Yes | Chart slices. Each item must include label and value; color is optional. |
| data[].color | String | No | 6-character hex color without the leading # symbol. Pattern: ^[A-Fa-f0-9]{6}$. |
| data[].label | String | Yes | Slice label. |
| data[].value | Number | Yes | Slice value. Must be greater than or equal to 0. |
| pies | Object Array | No | Alias for data. Deprecated. Use either data or pies, not both. Each item must include label and value; color is optional. |
| pies[].color | String | No | 6-character hex color without the leading # symbol. Pattern: ^[A-Fa-f0-9]{6}$. |
| pies[].label | String | Yes | Slice label. |
| pies[].value | Number | Yes | Slice value. Must be greater than or equal to 0. |
| theme | ENUM | No | Chart theme. Allowed values: light, dark. Default: light. |
| title | String | Yes | Chart title. Minimum length: 1. |
| options | Object | No | Rendering options for the chart. |
| options.width | Integer | No | Chart width in pixels. Minimum: 1. |
| options.height | Integer | No | Chart height in pixels. Minimum: 1. |
| options.title_style | Object | No | Title styling options. |
| options.title_style.padding | Integer | No | Padding in pixels. Minimum: 0. |
| options.title_style.font_size | Number | No | Font size in pixels. Minimum: 1. |
| options.title_style.font_color | String | No | 6-character hex color without the leading # symbol. Pattern: ^[A-Fa-f0-9]{6}$. |
| options.canvas_color | String | No | Canvas color as a 6-character hex value without the leading # symbol. Pattern: ^[A-Fa-f0-9]{6}$. |
Response
Returns a binary file response containing the generated pie chart image. The output schema is a binary string, so the success response is the image payload itself rather than a JSON object.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| binary | String | Yes | Generated pie chart image content returned as binary data. |