Documentation · Data
Pie chart
Write one slice per line. Shares are worked out for you, so the numbers can be counts rather than percentages.
When to use it
Show nonnegative shares of one whole, optionally as a donut.
Use shares that genuinely belong to the same total. Use a bar chart instead when comparing values matters more than the part-to-whole relationship.
Working example
Copy this complete example into the Source tab, then press Generate. Change its labels or values to make your first version.
pie "Cookie Market Share, 2023" {
percent on
"Mocha Marvels" 32.9
"Caramel Swirls" 24.4
"PB Bliss" 19.0
"Choco Chippers" 9.0
"Mint Melts" 7.4
"Berry Bursts" 7.2
}Syntax reference
The same reference used by the editor and AI briefing. Syntax is notation-specific; use the keywords listed here.
Chart
| Syntax | Meaning |
|---|---|
pie "Title" { | open a pie chart |
Slices
| Syntax | Meaning |
|---|---|
Apples 40 | one slice, named and measured |
"Mocha Marvels" 32.9 | a name with a space goes in quotes |
series "Share" 40 60 | the same slices, written as a series |
Pie
| Syntax | Meaning |
|---|---|
percent on | read the values as shares of the whole |
donut 0.5 | open a hole in the middle, 0 to 0.9 |
Look
| Syntax | Meaning |
|---|---|
colors colorful | auto, single, colorful, warm, cool, ink |
colors "#2a78d6" | one colour, pinned |
style framed | plain, ruled, framed, bold |
legend bottom | auto, none, right, bottom, top |
values on | write the number on every mark |
size 520 340 | how big the chart is drawn |
# comment | line comment (also //) |
Language rules
- The file is one pie "Title" { ... } block. Nothing may sit outside it.
- A reading is Name 40, one per line, and draws a slice per reading. A name with a space or a comma in it goes in quotes.
- Settings are written as name value, in any order, before or after the readings.
- A word that is a setting name is never read as a reading; quote it if you need it as a name.
- Use series only when there is more than one thing being measured; a single series needs no series line at all.
- Do not invent settings. Every one the language has is listed above.
Edit on the canvas
- Drag slice boundaries to adjust the distribution, or edit readings through the chart panel.
- Set slice labels, percentages, the donut hole and legend using the chart controls.
Generate replaces the drawing from source. Save before generating again if you want to preserve manual finishing touches.
Read Saving & exportingWrite it with an assistant
Tingraph AI already knows this notation. For another assistant, copy the tutorial below, describe your diagram under MY DIAGRAM, then paste the returned source into the editor. This prompt includes every syntax row, rule and working example above.
Read the complete prompt
You are writing Tingraph source. Tingraph is a small text language that draws a pie chart. Answer with Tingraph source only.
SYNTAX
Chart
pie "Title" { open a pie chart
Slices
Apples 40 one slice, named and measured
"Mocha Marvels" 32.9 a name with a space goes in quotes
series "Share" 40 60 the same slices, written as a series
Pie
percent on read the values as shares of the whole
donut 0.5 open a hole in the middle, 0 to 0.9
Look
colors colorful auto, single, colorful, warm, cool, ink
colors "#2a78d6" one colour, pinned
style framed plain, ruled, framed, bold
legend bottom auto, none, right, bottom, top
values on write the number on every mark
size 520 340 how big the chart is drawn
# comment line comment (also //)
RULES
- The file is one `pie "Title" { ... }` block. Nothing may sit outside it.
- A reading is `Name 40`, one per line, and draws a slice per reading. A name with a space or a comma in it goes in quotes.
- Settings are written as `name value`, in any order, before or after the readings.
- A word that is a setting name is never read as a reading; quote it if you need it as a name.
- Use `series` only when there is more than one thing being measured; a single series needs no `series` line at all.
- Do not invent settings. Every one the language has is listed above.
WORKED EXAMPLE
pie "Cookie Market Share, 2023" {
percent on
"Mocha Marvels" 32.9
"Caramel Swirls" 24.4
"PB Bliss" 19.0
"Choco Chippers" 9.0
"Mint Melts" 7.4
"Berry Bursts" 7.2
}
OUTPUT
- Reply with one fenced code block and nothing else.
- The block starts with `pie "…" {` and ends with `}`.
- Do not invent keywords: use only the ones listed above.
- Keep labels short enough to read inside a box, and keep every ID unique.
MY DIAGRAM
Describe what you want here, then send this message.Something unclear? Contact support or read the Privacy Policy.