apyhub
IMAGE PROCESSING · SMART GENERATION

Generate Bar Graph API

What it does

Simple Bar Chart generates bar chart images from a title and a list of bar values. Send title and data, where each item includes label and value; you can also include an optional color for each bar. Use theme to switch between light and dark, and fine-tune the output with options such as width, height, spacing, bar_width, background, title_style, x_axis, y_axis, and canvas_color.

Use POST /download when you want the rendered chart back as binary image data. Use POST /link when you want a pre-signed URL to the generated chart image. That makes this useful for dashboards, reports, admin panels, and internal tools that need charts without building chart rendering into the application.

Simple Bar Chart is a good fit when your data is already aggregated and you need a quick visual summary by category. A sales report, product comparison, regional breakdown, or usage snapshot can be turned into a shareable chart with just a few fields.

The request schema is strict: bar entries only accept label, value, and optional color, and options only accepts the documented layout and color settings. The response from /link is a single data URL field; /download returns the image itself.

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

QUICKSTART

GUIDE

Quickstart

Generate a simple bar chart image from a title and bar data.

curl -X POST "https://api.eu.apyverse.com/apyhub/generate-simple-bar-chart/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Quarterly Sales by Region",
    "data": [
      { "color": "3B82F6", "label": "North America", "value": 42000 },
      { "color": "10B981", "label": "Europe", "value": 37500 },
      { "color": "F59E0B", "label": "Asia Pacific", "value": 28900 }
    ]
  }'

What you'll get back

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

TRY ITLIVE · 60 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*
bars
Alias for data. Use either data or bars, not both.
data*
Canonical list of bar values.
data-1*
6-character hex color without the leading # symbol.
Chart theme.
options
Chart width in pixels.
Chart height in pixels.
x_axis
Font size in pixels.
6-character hex color without the leading # symbol.
y_axis
Font size in pixels.
6-character hex color without the leading # symbol.
Spacing in pixels.
Bar width in pixels.
background
6-character hex color without the leading # symbol.
Padding in pixels.
title_style
Padding in pixels.
Font size in pixels.
6-character hex color without the leading # symbol.
6-character hex color without the leading # symbol.

About this endpoint

What it does

Generates a bar chart image from the request body and returns the rendered image as binary content. The chart is configured with a required title and bar data, plus optional styling and layout options.

Request Body

ParameterTypeMandatoryDescription
titleStringYesChart title.
dataObject ArrayYesCanonical list of bar values. Each item must include label and value; color is optional and must be a 6-character hex color without the leading # if provided.
data[].colorStringNo6-character hex color without the leading # symbol.
data[].labelStringYesBar label.
data[].valueNumberYesBar value.
barsObject ArrayNoDeprecated alias for data. Use either data or bars, not both. Each item must include label and value; color is optional and must be a 6-character hex color without the leading # if provided.
bars[].colorStringNo6-character hex color without the leading # symbol.
bars[].labelStringYesBar label.
bars[].valueNumberYesBar value.
themeENUMNoChart theme. Allowed values: light, dark. Default: light.
optionsObjectNoChart layout and styling options. See nested fields below.
options.widthIntegerNoChart width in pixels. Minimum: 1.
options.heightIntegerNoChart height in pixels. Minimum: 1.
options.x_axisObjectNoX-axis styling options.
options.x_axis.font_sizeNumberNoFont size in pixels. Minimum: 1.
options.x_axis.font_colorStringNo6-character hex color without the leading # symbol.
options.y_axisObjectNoY-axis styling options.
options.y_axis.font_sizeNumberNoFont size in pixels. Minimum: 1.
options.y_axis.font_colorStringNo6-character hex color without the leading # symbol.
options.spacingIntegerNoSpacing in pixels. Minimum: 0.
options.bar_widthIntegerNoBar width in pixels. Minimum: 1.
options.backgroundObjectNoBackground styling options.
options.background.colorStringNo6-character hex color without the leading # symbol.
options.background.paddingIntegerNoPadding in pixels. Minimum: 0.
options.title_styleObjectNoTitle styling options.
options.title_style.paddingIntegerNoPadding in pixels. Minimum: 0.
options.title_style.font_sizeNumberNoFont size in pixels. Minimum: 1.
options.title_style.font_colorStringNo6-character hex color without the leading # symbol.
options.canvas_colorStringNo6-character hex color without the leading # symbol.

Response

Returns the chart image as a binary payload in the response body. The output schema is a binary string, so there is no JSON object wrapper or named response field to read.

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.