Creating Charts with Claude

Describe a chart in plain English, get back a production-ready config you can paste straight into the figure editor.

What is the OpenChart skill?

The OpenChart skill teaches Claude how to generate chart configurations (VizSpec JSON) that render as production-quality visualizations. Install it once, then describe any chart in natural language and Claude generates the config. It covers bar charts, line charts, scatter plots, annotations, animations, and more.

Install in Claude Code

Run these commands in Claude Code:

/plugin marketplace add tryopendata/skills
/plugin install openchart@openchart

Then invoke the skill with /openchart when you want Claude to generate a chart config. You can also just describe what chart you want and Claude will use the skill automatically.

Install in Claude.ai / Claude Desktop

Download the skill files from github.com/tryopendata/skills and upload them as project knowledge in your Claude project. See Anthropic's guide to using skills for step-by-step instructions.

Generate a chart

Ask Claude to create a chart. Some examples:

  • "Create a bar chart comparing GDP across G7 countries"
  • "Make a line chart showing monthly temperatures in San Diego for 2024"
  • "Generate an OpenChart config for a scatter plot of population vs GDP per capita"

Claude returns a VizSpec JSON object. Copy it.

Example VizSpec output
{
"mark": "bar",
"encoding": {
"x": { "field": "country", "type": "nominal" },
"y": { "field": "gdp", "type": "quantitative", "axis": { "format": "$,.1f" } }
},
"chrome": {
"title": "GDP by Country",
"subtitle": "Nominal GDP in trillions (2024)"
},
"data": [
{ "country": "US", "gdp": 28.78 },
{ "country": "China", "gdp": 18.53 },
{ "country": "Japan", "gdp": 4.11 },
{ "country": "Germany", "gdp": 4.59 }
]
}

Paste into the Figure Editor

Go to /figure/new, paste the JSON into the code editor on the left. The chart renders instantly on the right.

Fine-tune by:

  • Editing the JSON directly
  • Dragging annotations and labels on the chart
  • Using the mark picker to change chart types

When you're happy, click Save to publish your figure.

Tips for better results

  • Be specific about data. Provide actual numbers or reference a dataset rather than asking Claude to guess.
  • Ask for annotations. "Add a callout highlighting the peak in 2023" works great.
  • Iterate. "Change the color palette to warm tones" or "Make it a horizontal bar chart" are easy follow-ups.
  • Pull live data automatically. Install the OpenData API skill and Claude can search the catalog, find the right dataset, and feed the data directly into a chart config. No copy-pasting data.

Related

Search datasets

Search for datasets or run quick actions