---
title: "Line Chart Image Generator API — Trend charts | Imejis"
description: "Generate line chart images for trends over time — fresh data points and labels on every API call, styled to your brand. Create line chart images free."
url: "https://www.imejis.io/components/chart/line"
---

# Line Chart Image Generator API — Trend charts | Imejis

A line chart for trends over time.

## Use cases

- Weekly traffic or revenue trend emails
- Stock or metric movement snapshots
- OG images with a live trend line

## 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)". |

## Design JSON (this variant)

```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": "line",
        "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,
        "lineWidth": 3
      }
    }
  ]
}
```

## Examples

### Six-month traffic trend

Site visits per month with compact value formatting (1.2K style).

API overrides that reproduce this example:

```json
{
  "sales.chartType": "line",
  "sales.lineWidth": 3,
  "sales.data": [
    1200,
    1900,
    1700,
    2400,
    2600,
    3100
  ],
  "sales.labels": [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun"
  ],
  "sales.colors": [
    "#0EA5E9"
  ],
  "sales.valueFormat": "compact",
  "sales.showValues": true
}
```

### MRR growth for an investor update

Monthly recurring revenue as a currency-formatted line, axes captioned.

API overrides that reproduce this example:

```json
{
  "sales.chartType": "line",
  "sales.lineWidth": 3,
  "sales.data": [
    8200,
    9100,
    10400,
    12800,
    14100
  ],
  "sales.labels": [
    "Q1",
    "Q2",
    "Q3",
    "Q4",
    "Q5"
  ],
  "sales.colors": [
    "#10B981"
  ],
  "sales.valueFormat": "currency",
  "sales.currencySymbol": "$",
  "sales.yAxisLabel": "MRR"
}
```

## 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).

## Related

- [Chart component](https://www.imejis.io/components/chart.md) — full reference and FAQs
- [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.
