How to Prompt AI to Pick the Right Chart
Ask which chart looks best and you get a bar chart. Ask what comparison the reader must make and the chart choice stops being a matter of taste.
Paste a table into a chatbot and ask for the best way to chart it, and you will get a bar chart, a line chart if there is a date column, and a confident sentence about clarity. It is not wrong often enough to be useless and not right often enough to trust. The reason is that you asked an aesthetic question. To prompt AI to pick the right chart you have to make it answer a structural one first: what comparison does the reader need to make?
Chart choice is a solved problem in the data journalism world, and it is solved by category. The FT Visual Vocabulary, maintained in the Financial Times chart-doctor repository, and the European Union's open data visualisation guide both work the same way: you identify the relationship you want to show, and the category narrows you to a handful of appropriate charts. The trick with a language model is to make it walk that path instead of skipping to the end.
The nine data patterns
Both references organise charts by the message rather than the shape. The categories are these.
Pattern | The question it answers |
|---|---|
Deviation | How far above or below a reference point? |
Correlation | Does one variable move with another? |
Ranking | Where does this item sit in an order? |
Distribution | How are values spread, and where is the bulk? |
Change over time | What is the trend or the rate of change? |
Magnitude | How big is this compared with that? |
Part to whole | How does a total break down? |
Spatial | Where does this happen geographically? |
Flow | What moves from where to where? |
Almost every bad chart is a category error rather than a styling mistake. A pie chart used for ranking. A line chart used for magnitude across unrelated categories. A dual-axis chart used to imply correlation that the data does not show. Once the category is named, the shortlist is short and the wrong answers are visibly wrong.
Step 1: make it name the pattern, not the chart
The first prompt deliberately forbids a chart type. This is the whole technique.
Here is my data:
<data>
Region, Q3 target, Q3 actual
North, 420000, 503000
South, 380000, 341000
Midlands, 260000, 258000
Wales, 150000, 119000
</data>
The audience is our board, in a monthly review pack.
The one thing I want them to take away: which regions
missed target and by how much.
Do NOT suggest a chart type yet. Instead:
1. Name the data pattern from this list: deviation, correlation,
ranking, distribution, change over time, magnitude,
part to whole, spatial, flow.
2. State what is being compared with what, in one sentence.
3. Name the reference point or baseline, if there is one.For that data a correct answer names deviation, says each region's actual revenue is compared against its own target, and identifies the target as the baseline. That is the answer that rules out the chart most people would have reached for, which is paired bars of target and actual. Paired bars make the reader do the subtraction in their head for four regions, and the thing you said you wanted was the size of the miss.
If the model names magnitude instead, that is useful information: it means your framing of the takeaway was ambiguous, and you should fix the sentence rather than argue with the output. Making the model commit to an interpretation before it produces anything is the same move as prompting for a recommendation instead of options.
Step 2: ask for charts within the pattern
Now that the category is fixed, ask for choices inside it.
Good. Staying within the deviation pattern:
- Give me three chart options appropriate to deviation.
- For each: what the reader sees instantly, and what it hides.
- Say which you would pick for four categories and a board audience,
and why the other two are worse HERE specifically.
- Then give the exact data transformation I need: the columns
I must compute before plotting.For this data the strong answer is a diverging bar chart of variance against target, centred on zero, with the regions in order of variance. North goes right by 83,000, Wales goes left by 31,000, and the reader is done in a second. The alternatives inside deviation, such as a bullet chart or a dot plot with a target marker, are reasonable and the model should be able to say why they are weaker for four categories on a printed page.
The last instruction is the one that saves the most time. The chart needs a variance column and a percentage variance column that your source table does not have. Getting the transformation named with the recommendation means you are not back in the chat ten minutes later asking why your numbers look wrong. If the arithmetic is more than a subtraction, hand it off properly: see prompting AI to write a spreadsheet formula.
Three follow-ups when you prompt AI to pick the right chart
When the recommendation still feels off, these three follow-ups do more than rephrasing the original request.
How many categories, and how many will there be in a year? Charts fail by cardinality more than anything else. A diverging bar chart is excellent at four regions and unreadable at ninety SKUs, and a model that was not told the number will assume a comfortable one.
Where will this be seen? A board PDF, a dashboard tile 300 pixels wide and a phone screen have genuinely different answers, and small multiples are often the right answer for the first and never for the second.
What would make this chart misleading? Ask it directly. A truncated y-axis on a deviation chart, a dual axis implying correlation, percentages on a base of eleven responses. This is the question that catches the chart that is technically in the right category and still lies.
That third one is worth running every time. It is the charting version of asking a model to critique its own output, which is reliably more productive than asking it to be careful up front.
When the data is not ready
Half of bad chart advice comes from the model reading your column names and guessing. If the table has merged cells, a total row in the middle, dates stored as text and three spellings of the same region, the pattern it names will be based on a misreading. Clean first: cleaning messy spreadsheet data with AI covers the usual suspects, and prompting AI to analyse a spreadsheet covers getting a reliable read of what is in there before you ask anything about it.
One practical note: paste the data as text rather than describing it. Four rows of CSV in the prompt beats a paragraph about what the columns contain, every time, and it costs fewer tokens than the description.
Frequently asked questions
Why does AI always suggest a bar chart?
Because bar charts are the safe default across the most common patterns, and an unconstrained request is effectively asking for a safe default. Naming the pattern first removes the ambiguity that produces the hedge.
Is a pie chart ever the right answer?
For part to whole with two or three slices where the slices are genuinely parts of one total, yes, and that is about it. Any ranking question, any comparison across more than three categories, and any change over time is better served by something else. The category test catches this without an argument about taste.
Can the model generate the chart as well?
It can write the plotting code, and that part is usually fine once the type and transformation are settled. Keep it as a separate request: a prompt that decides and draws in one pass tends to produce a chart whose code quietly disagrees with the recommendation.
What if my takeaway sentence is hard to write?
Then the chart is not the problem yet. If you cannot state in one sentence what the reader should conclude, you are exploring rather than communicating, and exploration wants several quick ugly charts rather than one considered one.
Does this work for dashboards?
Yes, applied per tile. The common dashboard failure is six tiles that all answer magnitude questions and none that answers the deviation question the viewer actually opened it for. Run the pattern-naming step on each tile separately, then look at the set. Our prompt engineering pillar has the general structure behind this kind of staged prompt.
How did this land?
About the author

Developer Advocate
Steve builds something with Swarmz every week and writes up what worked, what broke, and what he'd do differently. Tutorials and hands-on guides are his lane.


