About this endpoint
What it does
Generates a bar chart image from the chart configuration in the request body and returns the image as binary data.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object Array | Yes | Canonical list of bar values. Each item supports label and value, and may include color. Requires at least 1 item. |
| data[].color | String | No | 6-character hex color without the leading # symbol. |
| data[].label | String | Yes | Bar label. |
| data[].value | Number | Yes | Bar value. |
| bars | Object Array | No | Alias for data. Deprecated. Use either data or bars, not both. Each item supports label and value, and may include color. |
| bars[].color | String | No | 6-character hex color without the leading # symbol. |
| bars[].label | String | Yes | Bar label. |
| bars[].value | Number | Yes | Bar value. |
| theme | ENUM | No | Chart theme. Allowed values: light, dark. Default: light. |
| title | String | Yes | Chart title. Must be at least 1 character. |
| options | Object | No | Chart layout and styling options. |
| options.width | Integer | No | Chart width in pixels. Minimum: 1. |
| options.height | Integer | No | Chart height in pixels. Minimum: 1. |
| options.x_axis | Object | No | X-axis styling options. |
| options.x_axis.font_size | Number | No | Font size in pixels. Minimum: 1. |
| options.x_axis.font_color | String | No | 6-character hex color without the leading # symbol. |
| options.y_axis | Object | No | Y-axis styling options. |
| options.y_axis.font_size | Number | No | Font size in pixels. Minimum: 1. |
| options.y_axis.font_color | String | No | 6-character hex color without the leading # symbol. |
| options.spacing | Integer | No | Spacing in pixels. Minimum: 0. |
| options.bar_width | Integer | No | Bar width in pixels. Minimum: 1. |
| options.background | Object | No | Background styling options. |
| options.background.color | String | No | 6-character hex color without the leading # symbol. |
| options.background.padding | Integer | No | Padding in pixels. Minimum: 0. |
| 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. |
| options.canvas_color | String | No | 6-character hex color without the leading # symbol. |
Response
Returns a binary response body containing the generated chart image.
Notes
bars is a deprecated alias for data. Use one or the other, not both.