ChartKitBETA

Documentation

One URL creates a chart. Copy the code, drop it in your Substack, Notion, blog, or any site. Or teach your ChatGPT, Claude, Gemini or any LLM to generate charts for you.

Embed Options

Image Tag

The simplest option. Just an <img> tag with a URL. Works in markdown, email, Notion, anywhere.

<img src="https://getchartkit.com/api/chart?type=bar&labels=Q1,Q2,Q3&s0=10,20,30&s0name=Sales" alt="Sales chart" />

Query Parameters

ParameterTypeRequiredDescription
typestringYes"bar" | "line" | "pie" | "area" | "horizontal-bar" | "donut"
labelsstringYesComma-separated category labels, e.g. labels=Q1,Q2,Q3
s0, s1, s2…stringYesComma-separated numbers per series, e.g. s0=10,20,30
s0name, s1name…stringNoName for each series, e.g. s0name=Revenue
s0color, s1color…stringNoHex color per series, e.g. s0color=4f46e5
titlestringNoChart title (use + for spaces)
wnumberNoWidth in pixels (default: 600)
hnumberNoHeight in pixels (default: 400)
legendbooleanNoShow legend (default: true)
valueFormatstringNo"number" | "currency" | "percent" | "compact" (default: "number")
currencySymbolstringNoCurrency symbol when valueFormat is "currency" (default: "$")
formatstringNo"svg" | "png" | "jpg" (default: "svg")
scalenumberNoRaster scale factor (default: 2)

Teach Your LLM

Copy this prompt and paste it into ChatGPT, Claude, Gemini or any LLM.

You can generate charts using ChartKit by constructing a URL and placing it in an <img> tag.

Base URL: https://getchartkit.com/api/chart

Query parameters:
- type (required): bar, line, area, pie, donut, or horizontal-bar
- labels (required): comma-separated category labels, e.g. labels=Q1,Q2,Q3,Q4
- s0, s1, s2... (at least s0 required): comma-separated numbers for each data series, e.g. s0=10,20,30
- s0name, s1name...: name for each series, e.g. s0name=Revenue
- title: chart title (use + for spaces), e.g. title=Monthly+Sales
- w: width in pixels (default 600)
- h: height in pixels (default 400)
- legend: true or false (default true)
- valueFormat: controls how values are displayed on axes (default: number)
    number — raw numbers with locale separators (1,000,000)
    currency — adds a currency symbol ($1,000,000). Use with currencySymbol.
    percent — appends % (42%)
    compact — shortens large numbers with K, M, B, T suffixes (1.5M, 2.3B). Pass full values in the data — the system formats them automatically.
- currencySymbol: currency symbol when valueFormat is currency, e.g. $, €, £ (default $)
- format: svg, png, or jpg (default svg)

Example:
<img src="https://getchartkit.com/api/chart?type=bar&labels=Q1,Q2,Q3&s0=10,20,30&s0name=Sales&title=Quarterly+Sales" alt="Sales chart" />

Example with compact format for large numbers:
<img src="https://getchartkit.com/api/chart?type=bar&labels=Q1,Q2,Q3,Q4&s0=1500000,2300000,3100000,4200000&s0name=Revenue&title=Annual+Revenue&valueFormat=compact" alt="Revenue chart" />

When I ask you to create a chart, generate the <img> tag with the appropriate URL. No libraries or API keys needed.

JavaScript Embed

Include the script, add data-* attributes. Gets you interactive, client-side rendering.

<script src="https://getchartkit.com/cdn/v1.js"></script>
<div data-chartkit data-type="bar" data-labels="Q1,Q2,Q3" data-series-0="10,20,30" data-series-0-name="Sales"></div>

Data Attributes

ParameterTypeRequiredDescription
data-chartkit-YesMarks the element as a chart container (no value needed)
data-typestringYes"bar" | "line" | "pie" | "area" | "horizontal-bar" | "donut"
data-labelsstringYesComma-separated labels, e.g. "Q1,Q2,Q3"
data-series-0, -1…stringYesComma-separated numbers per series, e.g. "10,20,30"
data-series-0-name…stringNoName for each series
data-series-0-color…stringNoHex color per series
data-titlestringNoChart title
data-widthnumberNoWidth in pixels (default: 600)
data-heightnumberNoHeight in pixels (default: 400)
data-legendbooleanNoShow legend (default: true)
data-value-formatstringNo"number" | "currency" | "percent" | "compact" (default: "number")
data-currency-symbolstringNoCurrency symbol when value format is "currency" (default: "$")

Teach Your LLM

Copy this prompt and paste it into ChatGPT, Claude, Gemini or any LLM.

You can generate interactive charts using ChartKit's JavaScript embed. Include the script tag once, then use <div> elements with data attributes.

Script: <script src="https://getchartkit.com/cdn/v1.js"></script>

Data attributes on the <div>:
- data-chartkit (required, no value needed)
- data-type (required): bar, line, area, pie, donut, or horizontal-bar
- data-labels (required): comma-separated labels, e.g. data-labels="Q1,Q2,Q3"
- data-series-0, data-series-1...: comma-separated numbers, e.g. data-series-0="10,20,30"
- data-series-0-name, data-series-1-name...: series names
- data-title: chart title
- data-width: width in pixels (default 600)
- data-height: height in pixels (default 400)
- data-legend: true or false
- data-value-format: controls how values are displayed on axes (default: number)
    number — raw numbers with locale separators (1,000,000)
    currency — adds a currency symbol ($1,000,000). Use with data-currency-symbol.
    percent — appends % (42%)
    compact — shortens large numbers with K, M, B, T suffixes (1.5M, 2.3B). Pass full values in the data — the system formats them automatically.
- data-currency-symbol: currency symbol when value format is currency, e.g. $, €, £ (default $)

Example:
<script src="https://getchartkit.com/cdn/v1.js"></script>
<div data-chartkit data-type="bar" data-labels="Q1,Q2,Q3" data-series-0="10,20,30" data-series-0-name="Sales" data-title="Quarterly Sales"></div>

When I ask you to create a chart, generate the script tag (once) and a <div> with the right data attributes. No API keys needed.

iFrame

Full isolation from the host page. Drop it in and forget about it.

<iframe src="https://getchartkit.com/api/chart?type=bar&labels=Q1,Q2,Q3&s0=10,20,30&s0name=Sales" width="600" height="400" style="border:none;"></iframe>

REST API

Generate charts server-side with a single HTTP request. Send a JSON body to POST /api/render and get back SVG, PNG, or JPG.

POST /api/render

Accepts a JSON chart configuration and returns the rendered chart image.

curl -X POST https://getchartkit.com/api/render \
  -H "Content-Type: application/json" \
  -d '{
    "type": "bar",
    "title": "Quarterly Sales",
    "labels": ["Q1", "Q2", "Q3", "Q4"],
    "datasets": [
      { "name": "2024", "data": [42, 58, 65, 71] },
      { "name": "2025", "data": [51, 63, 72, 80] }
    ],
    "width": 800,
    "height": 500,
    "legend": true,
    "valueFormat": "currency",
    "currencySymbol": "$"
  }'

Request Body Parameters

ParameterTypeRequiredDescription
typestringYes"bar" | "line" | "pie" | "area" | "horizontal-bar" | "donut"
labelsstring[]YesCategory labels for the x-axis
datasetsDataset[]YesArray of { name, data, color? }
titlestringNoChart title displayed at the top
widthnumberNoWidth in pixels (default: 600)
heightnumberNoHeight in pixels (default: 400)
legendbooleanNoShow legend (default: true)
valueFormatstringNo"number" | "currency" | "percent" | "compact" (default: "number")
currencySymbolstringNoCurrency symbol when valueFormat is "currency" (default: "$")
formatstringNo"svg" | "png" | "jpg" (default: "svg")

Teach Your LLM

Copy this prompt and paste it into ChatGPT, Claude, Gemini or any LLM.

You can generate chart images server-side using ChartKit's REST API.

Endpoint: POST https://getchartkit.com/api/render
Content-Type: application/json

Request body (JSON):
- type (required): "bar", "line", "area", "pie", "donut", or "horizontal-bar"
- labels (required): array of strings, e.g. ["Q1", "Q2", "Q3"]
- datasets (required): array of { "name": string, "data": number[] }
- title: chart title string
- width: number (default 600)
- height: number (default 400)
- legend: boolean (default true)
- valueFormat: controls how values are displayed on axes (default: "number")
    "number" — raw numbers with locale separators (1,000,000)
    "currency" — adds a currency symbol ($1,000,000). Use with currencySymbol.
    "percent" — appends % (42%)
    "compact" — shortens large numbers with K, M, B, T suffixes (1.5M, 2.3B). Pass full values in the data — the system formats them automatically.
- currencySymbol: currency symbol when valueFormat is "currency", e.g. "$", "€", "£" (default "$")

Query parameters:
- format: "svg", "png", or "jpg" (default "svg")
- scale: raster scale factor (default 2)

The response is the chart image in the requested format.

Example:
curl -X POST https://getchartkit.com/api/render \
  -H "Content-Type: application/json" \
  -d '{"type":"bar","labels":["Q1","Q2","Q3"],"datasets":[{"name":"Sales","data":[10,20,30]}]}'

When I ask you to create a chart, generate the appropriate curl command or fetch request. No API keys needed for basic use.