Diagram guides · Updated October 2026
Pie chart generator: the narrow case it fits, and the three it ruins
A pie chart does exactly one job well. It shows how a single total splits into a handful of parts, so a reader can see at a glance that one slice is about half and another is a sliver. For almost everything else it is the wrong picture, and reaching for it out of habit is how a clear set of numbers turns into a chart nobody can read. This guide covers when the percentage split is worth drawing, when it is not, and how to generate one.
The one-line version
Use a pie chart when the parts genuinely add up to one whole, there are five or fewer of them, and the point you are making is about proportion rather than comparison. If any of those three is false, draw something else.
One diagram per answer, so ask for one chart at a time.
What a pie chart is actually good at
There is a real question it answers better than anything else: how does this one total divide up. Three sources of funding, four categories of expenditure, the split between pass, merit and distinction. The circle itself is the message, because it says without a word that these parts make a complete whole and nothing has been left out.
That is a narrower job than it sounds. The reader takes away a rough shape rather than a set of figures, so a pie works when a rough shape is the point. If the next sentence of your report depends on the difference between two categories that are close in size, the chart has already failed and no amount of styling will rescue it.
Three times a pie chart is the wrong chart
None of these are matters of taste. They come from what the eye can measure. A bar chart lets the reader compare lengths against a shared baseline, a line chart gives change a direction, and a pie gives you angles, which are the hardest of the three to judge.
The trap that catches most survey data
Here is the one that slips past almost everybody. You ask a survey question where people may tick more than one box, then you chart the percentage of respondents who chose each option. Those numbers add up to well over a hundred, because a single person can be counted in three of the categories at once.
A pie chart cannot represent that, and it will not refuse to try. Whatever tool you use will quietly rescale the values so they fill the circle, which produces slices that look like parts of a whole and are nothing of the kind. The reader has no way of telling, which makes it the most misleading chart in the set.
The fix is a bar chart with one bar per option, each showing what share of respondents picked it. Bars do not imply that the categories are mutually exclusive, so overlapping membership causes no problem at all. The same applies to any measurement where one item can belong to two groups.
Generating the chart when a pie really does fit
Diagrams come back as Mermaid, and the generator leans towards a flowchart unless the prompt says otherwise, so name the type. Ask Flowchart Answers for a pie chart and give it the labels with their values in the same sentence. The block it produces is small enough to read and edit directly:
pie title Where the week went "Lectures" : 12 "Reading" : 9 "Lab work" : 7 "Revision" : 5
Those hours are made up for the sake of the example. The structure is what matters: a title line, then one row per slice holding a quoted label and a number. Mermaid works out each share from the raw values, so you never type a percentage yourself and the figures cannot drift out of step with the data behind them.
The code appears beside the preview and the picture redraws as you edit, which makes correcting a value a one-character job rather than a new request. The quoting is not decoration either. A label containing a bracket or a quote has to be quoted or Mermaid reads the bracket as structure: a node written as G[Sugar (food)] breaks the parse while G["Sugar (food)"] renders, and one bad label takes down the whole diagram.
Four rules for the data before it reaches the chart
Give the chart a title that states the conclusion rather than the subject. Where the week went is better than Weekly hours, because a reader who sees only the title has still learned something. Then zoom the preview, check the narrow slices for colliding labels, and download the SVG.
What to reach for instead
Being straight about this matters more than defending the chart. When bars are the right answer, ask for bars: alongside the pie block Mermaid has an xychart-beta type that draws bar and line charts, so name it in your prompt rather than settling for a circle. It is marked beta and its axis syntax is fussier than the pie block’s, so say which type you want instead of asking vaguely for a chart. Picking a pie because it is the one you can make in ten seconds is exactly how bad charts get into reports.
What this tool is genuinely good for is the rest of the diagram family, where it has no competition from a spreadsheet at all. Processes and decisions are covered in the flowchart guide, the choice between diagram types in the diagram type guide, and the basics of getting something on the page in how to draw a diagram. A chart you already have, in a textbook or on a slide, is a job for Image Summary instead.
Pie chart FAQ
When is a pie chart the wrong chart?
Three situations cover nearly all of it. When there are more than about five slices, because the small ones become indistinguishable wedges. When the reader needs to compare values rather than see proportions, because people judge the length of a bar far more accurately than the angle of a wedge. And whenever time is involved, because a pie has no axis to put time on, so a trend has to be split across several pies that nobody can compare.
How many slices is too many?
Past five or six the chart stops working. Each extra category makes every wedge narrower, the labels start colliding with each other, and the reader ends up matching colours to a legend instead of reading the picture. The usual fix is to keep the largest few categories as they are and collapse the rest into a single slice called Other, which is honest as long as you say what went into it.
Do the values have to add up to 100?
No, and you should not convert them yourself. Mermaid calculates each share from the raw numbers you give it, so entering the actual counts means the arithmetic cannot drift and the percentage on each slice is always consistent with the data. What does matter is that the numbers are genuinely parts of one whole.
Why do my survey percentages add up to more than 100?
Because the question let people pick more than one answer. Percentage of respondents who chose each option is not a part-to-whole measurement at all: one person can be inside three slices at once, so the slices overlap and the circle is a lie. Those numbers need a bar chart with one bar per option, where overlapping membership causes no problem.
Can I make a bar chart with the same tool?
Yes. As well as the pie block, Mermaid has an xychart-beta type that draws bar and line charts, so name that type in your prompt when bars are what the data needs. It is marked beta and its axis syntax is stricter, so ask for xychart-beta explicitly rather than just asking for a chart. Choosing a pie only because it is the one you know how to generate is how most bad charts get made.
Why did my request come back as a flowchart?
The generator leans towards a top-down flowchart when the prompt does not name a type, and a description of some data reads like anything else. Put the word pie in the request along with the labels and their values, and the draft comes back as a chart. You can also change the first line of the code yourself, since the preview redraws from the editor.
Should I write the percentage on each slice?
Mermaid works out the share of each slice from your raw values, so you do not need to compute or type the figures in. Keep your own labels to the name of the category. A label that already has a number baked into it will sit next to the calculated one and the two will eventually disagree when the data changes.
Can I download the pie chart?
Yes, as SVG, which is a vector file and stays sharp at any size in a report or on a slide. Zoom the preview before downloading and check the thin slices, because a label on a narrow wedge is the first thing to collide with its neighbour.
Can it explain a chart I already have?
That is a different tool. Photograph or screenshot the chart and run it through Image Summary, which describes what a chart is showing in plain language rather than only reading the axis labels back to you.
Related diagram & flowchart guides
- AI flowchart generatorDescribe a process, get a flowchart.
- AI diagram generatorWhich diagram fits which question.
- How to draw a diagramPick a shape set and start somewhere.
- ER diagram generatorEntities, keys and relationships.
- Sequence diagram generatorWho calls whom, in order.
Tools: Flowchart Answers · Video Answers · Ask Questions