---
title: "Chart Image API — Generate chart images via API | Imejis"
description: "Render bar, line and area charts as images with axes, legends and value formatting — send fresh data and labels on every API call. Start charting free."
url: "https://www.imejis.io/components/chart"
---

# Chart Image API — Generate chart images via API | Imejis

Bar, line and area charts with single- or multi-series data, labels, legends, axes and value formatting — dashboard-quality charts rendered straight into your image.

## Use cases

- Weekly KPI report images posted to Slack or email
- OG images with live stats for blog posts and dashboards
- Automated investor and client report graphics
- E-commerce sales trend snapshots
- Social cards visualizing survey results

## Authoring notes

- Use a wide box for bar/line/area charts.
- Single series: `data` + `labels`. Multi-series: `series` [{ name, data, color }] — enables grouped/stacked bars and multi-line.
- For pie or donut charts use the dedicated pie component.

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `chartType` | `'bar' \| 'line' \| 'area'` | `"bar"` | Chart style. |
| `data` | `number[]` | `[]` | Single-series data values (ignored when series is set). |
| `series` | `object[]` | `[]` | Multi-series data: array of { name?, data: number[], color? }. |
| `labels` | `string[]` | `[]` | Category labels along the x-axis. |
| `colors` | `color[]` | `[]` | Color palette. Multi-series: one color per series. Single-series bar charts: colors[i] colors bar i individually (empty string = inherit). |
| `orientation` | `'vertical' \| 'horizontal'` | `"vertical"` | Bar direction for bar charts. |
| `stacked` | `boolean` | `false` | Stack multiple series on top of each other. |
| `sparkline` | `boolean` | `false` | Minimal mode: hides axes, grid and labels. |
| `showAxis` | `boolean` | `true` | Show the x/y axes. |
| `showGrid` | `boolean` | `true` | Show background grid lines. |
| `showValues` | `boolean` | `false` | Print each data value on the chart. |
| `showLegend` | `boolean` | — | Show the series legend. |
| `legendPosition` | `'top' \| 'right' \| 'bottom'` | `"bottom"` | Where the legend is placed. |
| `valueFormat` | `'number' \| 'compact' \| 'percent' \| 'currency'` | `"number"` | How values are formatted (1200, 1.2K, 12%, $1,200). |
| `currencySymbol` | `string` | `"$"` | Currency symbol used with the 'currency' format. |
| `textColor` | `color` | `"#52514e"` | Color of axis labels and values. |
| `gridColor` | `color` | `"#e6e6e3"` | Color of the grid lines. |
| `xAxisLabel` | `string` | — | Caption below the x-axis. |
| `yAxisLabel` | `string` | — | Caption beside the y-axis. |
| `lineWidth` | `number` (min 0) | `2` | Stroke width for line/area charts in pixels. |
| `opacity` | `number` | `1` | Overall component opacity from 0 (transparent) to 1 (opaque). |
| `borderWidth` | `number` | `0` | Border thickness in pixels around the component. |
| `borderColor` | `color` | `"transparent"` | Border color (any CSS color). |
| `borderStyle` | `'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'none'` | `"solid"` | Border line style. |
| `borderRadius` | `number` | `0` | Corner radius in pixels. |
| `boxShadow` | `string` | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |

## Sample design JSON

```json
{
  "title": "Chart sample",
  "description": "A dynamic bar chart",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-chart",
      "key": "sales",
      "type": "chart",
      "position": {
        "x": 140,
        "y": 60
      },
      "rotation": 0,
      "size": {
        "width": 520,
        "height": 300
      },
      "dynamic": true,
      "properties": {
        "chartType": "bar",
        "data": [
          12,
          28,
          20,
          34,
          26
        ],
        "labels": [
          "Mon",
          "Tue",
          "Wed",
          "Thu",
          "Fri"
        ],
        "colors": [],
        "orientation": "vertical",
        "showAxis": true,
        "showGrid": true,
        "showValues": false,
        "valueFormat": "number",
        "opacity": 1
      }
    }
  ]
}
```

## Examples

### Weekly signups report

A Slack-ready bar chart of new signups per weekday, values printed on the bars.

API overrides that reproduce this example:

```json
{
  "sales.data": [
    142,
    189,
    173,
    236,
    208
  ],
  "sales.labels": [
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri"
  ],
  "sales.colors": [
    "#6366F1"
  ],
  "sales.showValues": true,
  "sales.yAxisLabel": "Signups"
}
```

### Monthly revenue in dollars

Revenue per month formatted as currency, compact enough for an email header.

API overrides that reproduce this example:

```json
{
  "sales.data": [
    12400,
    15800,
    14200,
    19600,
    22300
  ],
  "sales.labels": [
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun"
  ],
  "sales.colors": [
    "#10B981"
  ],
  "sales.valueFormat": "currency",
  "sales.currencySymbol": "$",
  "sales.showValues": true
}
```

## API overrides

Feed fresh numbers via '<key>.data' (or '<key>.series' for multi-series), and swap '<key>.labels' or '<key>.chartType' per render.

Flat override payload (`key.property` addressing) with the sample design's current values — send only the keys you want to change:

```json
{
  "sales.chartType": "bar",
  "sales.data": [
    12,
    28,
    20,
    34,
    26
  ],
  "sales.labels": [
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri"
  ],
  "sales.colors": [],
  "sales.orientation": "vertical",
  "sales.showAxis": true,
  "sales.showGrid": true,
  "sales.showValues": false,
  "sales.valueFormat": "number",
  "sales.opacity": 1
}
```

```bash
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "sales.chartType": "bar",
    "sales.data": [
        12,
        28,
        20,
        34,
        26
    ],
    "sales.labels": [
        "Mon",
        "Tue",
        "Wed",
        "Thu",
        "Fri"
    ],
    "sales.colors": [],
    "sales.orientation": "vertical",
    "sales.showAxis": true,
    "sales.showGrid": true,
    "sales.showValues": false,
    "sales.valueFormat": "number",
    "sales.opacity": 1
}'
```

`{{YOUR_DESIGN_ID}}` and `{{YOUR_API_KEY}}` are placeholders: first create
the design in your account (paste the sample design JSON above into the
editor at https://app.imejis.io, or create it programmatically via the
imejis MCP server's `create_design` + `update_design` tools), then render
it with the design's id and one of your API keys.

Agents: the MCP server at https://api.imejis.io/api/mcp exposes this same
catalog as structured data via the `list_component_types` tool (property
kinds, allowed values, bounds, ready-to-use sample designs).

## Frequently Asked Questions

### Can I change the chart data per API call?

Yes — send '<key>.data' for a single series or '<key>.series' for multi-series, plus '<key>.labels'; even chartType can switch per render.

### Which chart types are supported?

Bar (vertical or horizontal), line and area — with stacking for multiple series and a sparkline mode that hides axes, grid and labels.

### Can I plot more than one series?

Yes. Pass series as an array of { name, data, color } objects, enable stacked to pile them up, and show a legend positioned top, right or bottom.

### How do I format values as currency or percentages?

valueFormat supports number (1,200), compact (1.2K), percent and currency, with a configurable currencySymbol for the currency format.

## Variants

- [Line](https://www.imejis.io/components/chart/line.md) — A line chart for trends over time.
- [Area](https://www.imejis.io/components/chart/area.md) — A filled area chart — trends with volume emphasis.
- [Horizontal bars](https://www.imejis.io/components/chart/horizontal-bars.md) — Bars running left-to-right — rankings and long category names.
- [Stacked series](https://www.imejis.io/components/chart/stacked-series.md) — Two series stacked per category with a legend.
- [Sparkline](https://www.imejis.io/components/chart/sparkline.md) — Axis-free mini line — inline trend indicators and stat tiles.
- [Multi-line](https://www.imejis.io/components/chart/multi-line.md) — Several lines compared on one chart with a legend.

All components: https://www.imejis.io/components.md
