Claude Code for Non-Developers
Working with Data

Creating Charts and Visualizations

How to turn your data into bar charts, line graphs, and other visuals using Claude Code

From numbers to pictures

A table of monthly revenue is useful. A bar chart of monthly revenue is something you can drop into a presentation and everyone gets it in two seconds.

Claude Code can create charts directly from your data files. You describe what you want to see, and it generates an image file or an interactive page you open in your browser. You won't need to pick chart libraries, write plotting code, or configure axes. You say what you want the chart to show.

Worked example: a quarterly sales chart

Let's walk through a real example. You have a file called customer_orders.csv — the same kind of sales data we've been working with throughout this module. Your manager wants a chart showing monthly revenue for the quarter.

Here's the conversation, step by step.

Step 1: Ask for the chart.

Create a bar chart showing total revenue by month from customer_orders.csv

Claude Code reads the file, groups the orders by month, totals the revenue for each, and generates a chart. Behind the scenes, it writes a Python script that crunches the numbers and creates the image — the same way it's been handling all your data tasks in this module. You'll see something like:

I've created a bar chart of monthly revenue and saved it as monthly_revenue.png
in your project folder.

The chart shows:
- October: $142,380
- November: $168,920
- December: $195,445

A new file appears in your project folder: monthly_revenue.png.

Step 2: Open the chart.

On a Mac, Claude Code can run the open command to display the chart in your default image viewer. If it doesn't do this automatically, ask:

Open the chart you just created

The image appears in Preview (on Mac) or your default image viewer on Windows.

You can also double-click the file in your file explorer.

Step 3: Ask for changes.

The chart looks fine, but the bars use a default color and the title is generic. You want it polished enough for your manager.

Make the bars dark blue, add a title "Q4 2025 Monthly Revenue", and put dollar amounts on top of each bar

Claude Code regenerates the chart with your changes and saves the updated file. The old version gets overwritten unless you ask for a different filename.

You can keep refining. Each request builds on what's already there:

Make the y-axis start at zero and add a light gray gridline behind the bars
Increase the font size — this is going into a slide deck

Claude Code updates the chart and saves the result each time. You describe the problem in your own words — "the numbers on the bottom are overlapping" — and it figures out the right fix.

Tip: If you want to keep an earlier version, say "save this as monthly_revenue_v2.png instead of overwriting the original."

What your charts look like

Claude Code creates two types of visual output.

Image files (PNG format) are the most common. These are static pictures — bar charts, line graphs, pie charts, scatter plots. They look like what you'd make in Excel or Google Sheets, but Claude Code handles the sizing, labeling, and formatting for you. Open them in your image viewer or drop them straight into a slide deck or document.

Interactive HTML pages are the other option. These are web pages you open in your browser. You can hover over data points to see exact values, zoom in and out, and sometimes filter the data. They're great for exploring data on your own, but harder to drop into a PowerPoint.

If you don't specify, Claude Code creates a PNG file. To get an interactive chart, ask for one:

Create an interactive chart of monthly revenue that I can open in my browser

Claude Code saves an HTML file in your project folder. Double-click it, and it opens in Chrome, Safari, or whatever browser you use.

Heads up: Interactive HTML charts look great but can be tricky to share. You can't paste them into an email or a slide. They work best for your own exploration or for internal dashboards. When in doubt, stick with PNG files for anything you need to send to someone else.

Types of charts you can ask for

You can describe what you want without knowing chart terminology. Tell Claude Code what relationship you're trying to show, and it picks the right chart type.

If you do have a preference, ask directly:

What you want to showWhat to ask for
Comparing values across categories"Create a bar chart of revenue by region"
Tracking change over time"Create a line chart of monthly sales over the past year"
Showing parts of a whole"Create a pie chart of revenue by product category"
Showing how two numbers relate"Create a scatter plot of order size vs. customer tenure"
Comparing two things over time"Create a line chart with both revenue and expenses by month"

You can also leave the chart type up to Claude Code:

Show me how revenue has changed month to month this year

It'll pick a line chart because that's what fits. If you'd rather see bars, just say so:

Actually, make that a bar chart instead

Refining your charts

In Module 2, you learned to review what Claude Code produces and ask for changes. Charts work the same way — the first version is a draft.

Look at it, decide what needs to change, and describe the change in plain language. Here are the kinds of adjustments that come up most:

Colors and styling:

Make the bars dark blue instead of the default color

Use a white background with no border

Make the chart wider so the month labels don't overlap

Labels and text:

Add a title: "Revenue by Region — Q4 2025"

Put the exact dollar values on top of each bar

Remove the legend — there's only one data series

Layout and readability:

The x-axis labels are overlapping — rotate them so they fit

Make everything bigger — this needs to be readable on a projector

Add gridlines so it's easier to compare the bar heights

You describe the problem — "the labels are overlapping" — and Claude Code figures out what to change. You don't need to know the technical fix.

Tip: If you're making a chart for a specific context, tell Claude Code upfront. "This chart is going into a board deck" produces different sizing and formatting than "this is for my own notes."

Charts vs. summary tables

Not everything needs to be a chart.

If you want exact numbers — the top five products by revenue, or a breakdown of expenses by category — a table is often clearer. Charts are better for showing trends and patterns at a glance.

A rough guide:

  • Use a chart when you want someone to see a pattern or comparison right away.
  • Use a table when you want someone to look up specific numbers.
  • Use both when you're building a report — the chart for the overview, the table for the details.

You can ask Claude Code for either, or both at once:

Show me monthly revenue as both a bar chart and a table with exact numbers

Quick reference: chart prompts

What you wantWhat to type
A bar chart from your data"Create a bar chart of [measure] by [category] from [file]"
A line chart over time"Create a line chart showing [measure] over time from [file]"
An interactive chart"Create an interactive chart of [measure] by [category]"
Styling changes"Make the bars [color], add a title, increase the font size"
Save with a specific name"Save the chart as [filename].png"
Compare two things"Create a chart comparing [measure A] and [measure B] by [time period]"
Open the result"Open the chart you just created"

Next, you'll move from single charts to full reports — combining data summaries, charts, and written analysis into documents you can share with your team.

On this page