Skip to main content
Lesson 5 of 14 · ChatGPT for Data Analysis

Generate charts and tables

Lesson 5 of 14 Updated November 5, 2026 Intermediate
On this page
  1. Turn numbers into visuals
  2. Request a simple chart
  3. Generate formatted tables
  4. Combine data and visuals
  5. Multiple charts
  6. Cross-tabulation tables
  7. Download your visuals
  8. Your turn
  9. Key takeaways

Turn numbers into visuals

A table with 10,000 rows tells no one anything. A well-built chart tells a story at a glance: a March drop jumps out where it was lost in column D. ChatGPT generates these visualizations directly in the conversation by writing and executing Python code. You don’t write the code, but you can display it—and ask for a fix in a follow-up message if the result doesn’t match your intent.

Request a simple chart

The most direct phrasing is enough to get a first visual:

Create a bar chart of revenue by region.

ChatGPT generates the Python code, runs it, and displays the chart in the conversation. If you don’t specify the chart type, it chooses one for you—not always the one you had in mind. Name the type as soon as you know what you want. Five families cover most common needs, and it’s worth keeping them in mind before you phrase your request.

TypeUse caseExample prompt
BarCompare categories”Revenue by product as a bar chart”
LineTrend over time”Monthly sales line chart”
PieProportional breakdown”Market share by segment”
ScatterCorrelation between two variables”Scatter plot of price vs. quantity”
HistogramDistribution of a variable”Distribution of amounts”

ChatGPT can also produce box plots, heatmaps, area charts, radar charts, treemaps, bubble charts, and waterfall charts. Bars, lines, pies, and scatter plots can often be displayed in an interactive version: choose “Switch to interactive chart,” then “Switch to static chart” to return to the image. Other types remain static images.

Generate formatted tables

A chart isn’t always the right answer. When your reader needs exact values—an executive committee comparing budgets to the nearest thousand euros—a table is superior: no one reads a budget off a scaled axis.

Create a pivot table with regions as rows,
quarters as columns, and total revenue in each cell.
Add a totals row at the bottom.

ChatGPT builds the pivot table, usually with pandas, and displays it in an interactive table you can expand. If your destination is a document, email, or documentation page, specify the output format in your request to avoid reformatting everything by hand later:

Format the result as a Markdown table I can copy.

Combine data and visuals

The real power of the tool is that calculation and visualization live in the same flow. You can therefore request both at once and cross-check one against the other.

Calculate monthly revenue by category, display the results table,
then generate a stacked bar chart showing each category's contribution
to total revenue by month.

You get both the exact figures and their representation. This dual output isn’t a luxury: it’s how you catch that a segment looks squashed on the chart even though it accounts for 18% of the total, or that a visually dominant bar actually covers three marginal products.

Multiple charts

For an overview, request several charts in a single move:

Generate 4 charts on a single figure:
1. Total revenue by month (line)
2. Number of orders by month (bar)
3. Average order value by month (line)
4. Sales breakdown by category (pie)

ChatGPT creates a figure with subplots. The benefit is analytical as much as aesthetic: by aligning revenue, volume, and average order value on the same time axis, you immediately see whether a revenue increase comes from more orders or larger orders. These two situations call for neither the same explanation nor the same business decisions.

Cross-tabulation tables

To analyze the relationship between two categorical variables, a cross-tabulation table is the most readable tool available.

Create a cross-tabulation between "customer_segment" and "product_category"
with the number of orders in each cell.
Highlight the cells with the highest values.

This cross-tab reveals which segments buy which types of products, and especially which cells are empty. A segment that never buys a given range is either a market to open or a targeting issue to correct—in either case, the insight is immediately actionable straight out of the conversation.

Download your visuals

Every generated chart is downloadable: the button in the top right lets you enlarge it or download it, in PNG by default. A table produced by ChatGPT downloads the same way, in CSV format. For a visual intended to be enlarged—a poster, a printout—specify the expected size and resolution in your request. And for a formatted Excel workbook, with its tabs and formulas, use ChatGPT Work or ChatGPT for Excel, covered in Lesson 8.

Chart or table? Two columns. Chart: to see a trend or compare, downloaded as PNG; bars, lines, pies, and scatter plots often have an interactive version. Table: for exact values, downloaded as CSV; for a formatted workbook, use ChatGPT Work or ChatGPT for Excel. VISUALIZATION Chart or table? Chart For Seeing a trend, comparing Download PNG by default Interactive Bars, lines, pies, scatter plots Table For Reading exact values Download CSV Formatted workbook ChatGPT Work or ChatGPT for Excel Request both at once: the table verifies the chart.
Based on the article "Extracting Insights with ChatGPT Data Analysis" from the OpenAI Help Center (November 2026).

Your turn

Your first visual.

  1. Request a bar chart on your file, naming the columns
  2. Display the underlying data table and manually verify a total
  3. Switch the chart to interactive mode, if offered
  4. Request a figure with four charts on the same time axis
  5. Download the chart and the table

Official sources: Extracting Insights with ChatGPT Data Analysis · Data analysis with ChatGPT (OpenAI Help Center)

Key takeaways

  • ChatGPT generates charts by executing Python code, which you can display
  • Specify the chart type and relevant columns for immediate results
  • Combine tables and charts in the same analysis flow
  • Request multiple charts on one figure for an overview
  • Charts download as PNG, tables as CSV: use the button in the top right
  • Bars, lines, pies, and scatter plots often have an interactive version