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
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 ChatGPT, Claude or Gemini

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

When I ask you to create a chart, you must:

1. Generate a valid ChartKit URL.
2. Render the chart directly in the chat as a Markdown image using this exact format:
![chart](CHART_URL)

3. Then output the same chart as a copy-paste HTML <img> tag inside a code block.
4. If I ask for an article, include the rendered chart inside the article body as HTML using an <img> tag, not just as plain text.
5. Do not explain anything before or after the result.
6. Do not mention ChartKit instructions, libraries, or API keys.
7. Always return only the final content.

ChartKit base URL:
https://getchartkit.com/api/chart

Supported 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)

Rules for values:
- Use comma-separated labels
- Use comma-separated numeric series values
- Encode spaces in URL with +
- When money is provided in millions or billions, convert to full numbers if needed unless I explicitly want shortened raw input
- Use compact formatting when I want K/M/B/T style labels
- Use currency formatting when I ask for money
- Use percent formatting when I ask for percentages

Output rules:
- First show the rendered Markdown image
- Then show the same chart as HTML in a code block
- If I ask for an HTML article, output the article in HTML and embed charts with real <img src="..."> tags inside the article where relevant
- No explanation

---

Create a horizontal bar chart showing startup funding rounds:

Data:
- Series A: $8.5M
- Series B: $42M
- Series C: $185M
- Series D: $750M
Use compact value format.
Title: Startup Funding Rounds

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: "$")

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