8 min read
Lesson 2 of 6
Generating Charts & Graphs with AI
From the course AI for Data Visualization: Charts, Dashboards & Insights
The fastest way to create charts in 2026 is to describe what you want in natural language. Here's how to get great results from AI chart generation.
Prompting for Charts
Bad prompt: "Make a chart of my sales data" Good prompt: "Create a grouped bar chart comparing quarterly revenue by product line for 2024 vs 2025. Use a clean, minimal style with a color palette suitable for a business presentation. Add data labels on each bar."
The Chart Prompt Formula
[Chart type] + [Data description] + [Comparison/relationship] + [Style preferences] + [Annotations]
Chart Type Selection Guide
- Comparison → Bar chart, grouped bar chart
- Trend over time → Line chart, area chart
- Part of whole → Pie chart, donut chart, treemap
- Distribution → Histogram, box plot, violin plot
- Correlation → Scatter plot, bubble chart
- Geographic → Map, choropleth
- Flow/process → Sankey diagram, funnel chart
Working with ChatGPT (Advanced Data Analysis)
- Upload your CSV or Excel file
- Ask: "Analyze this dataset. What are the key columns, data types, and any data quality issues?"
- Ask: "What are the 3 most interesting insights in this data?"
- Request specific charts: "Create a line chart showing [metric] over [time period], with a trend line and confidence interval"
Working with Claude Artifacts
Claude generates interactive charts using React + Recharts:
- Paste your data or describe it
- Ask: "Create an interactive bar chart with this data that allows hovering over bars to see values"
- Claude generates a live, interactive artifact you can modify
Styling Tips
- Specify color palettes: "Use blues and grays" or "Use a colorblind-safe palette"
- Request minimal design: "Remove gridlines, use a clean white background"
- Add context: "Include a subtitle explaining the key takeaway"
- Specify dimensions: "Make it 16:9 aspect ratio for a slide deck"
Key Takeaways
- •Use the formula: chart type + data + comparison + style + annotations
- •Match chart types to data relationships: comparison, trend, distribution, correlation
- •ChatGPT Advanced Data Analysis handles CSV uploads and generates charts directly
- •Claude Artifacts creates interactive React-based charts in real time
- •Specify color palettes, dimensions, and styling for presentation-ready output
0 of 6 lessons marked complete
Progress is kept in this browser only.