Skip to documentation content

Documentation · Data

Area chart

Name the readings along the axis, then one series per band. Stacked bands pile up into the whole; overlapping ones each stand on zero.

Open Area chart

When to use it

Show how several quantities add up to a whole over time, or how two or three trends compare when their areas overlap.

Stack bands only when they add up to something meaningful. Put the steadiest band at the bottom, because every band above it is read against it.

Working example

Copy this complete example into the Source tab, then press Generate. Change its labels or values to make your first version.

Tingraph source
area "Energy use by source" {
  x "Year"
  y "TWh"
  categories 2015 2016 2017 2018 2019 2020
  series "Coal" 40 38 35 30 26 22
  series "Gas" 25 27 29 31 33 34
  series "Renewables" 8 11 14 18 23 29
  layout stacked
}

Syntax reference

The same reference used by the editor and AI briefing. Syntax is notation-specific; use the keywords listed here.

Chart

SyntaxMeaning
area "Title" {open an area chart

Readings

SyntaxMeaning
categories 2018 2019 2020name the readings along the axis
series "Coal" 40 38 35one band across those categories
series "Gas" "#eb6834" 25 27a band in a colour of its own
2018 40one reading, for a single band

Bands

SyntaxMeaning
layout stackedstacked (each band on the one below) or overlap
curve onjoin the readings with a curve
markers ona dot at every reading

Axes

SyntaxMeaning
x "Caption"caption under the across axis
y "Caption"caption beside the up axis
grid valuenone, value, category, both
range 0 250pin where the value axis runs

Look

SyntaxMeaning
colors colorfulauto, single, colorful, warm, cool, ink
colors "#2a78d6"one colour, pinned
style framedplain, ruled, framed, bold
legend bottomauto, none, right, bottom, top
values onwrite the number on every mark
size 520 340how big the chart is drawn
# commentline comment (also //)

Language rules

  • The file is one area "Title" { ... } block. Nothing may sit outside it.
  • A reading is Name 40, one per line, and draws a band through the readings. 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 the dot at the top of a band to change that reading; in a stacked chart it changes that band alone.
  • Switch between stacked and overlapping bands, curves and dots in the chart panel.

Generate replaces the drawing from source. Save before generating again if you want to preserve manual finishing touches.

Read Saving & exporting

Write 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 area chart. Answer with Tingraph source only.

SYNTAX
Chart
  area "Title" {              open an area chart

Readings
  categories 2018 2019 2020   name the readings along the axis
  series "Coal" 40 38 35      one band across those categories
  series "Gas" "#eb6834" 25 27  a band in a colour of its own
  2018 40                     one reading, for a single band

Bands
  layout stacked              stacked (each band on the one below) or overlap
  curve on                    join the readings with a curve
  markers on                  a dot at every reading

Axes
  x "Caption"                 caption under the across axis
  y "Caption"                 caption beside the up axis
  grid value                  none, value, category, both
  range 0 250                 pin where the value axis runs

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 `area "Title" { ... }` block. Nothing may sit outside it.
- A reading is `Name 40`, one per line, and draws a band through the readings. 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
area "Energy use by source" {
  x "Year"
  y "TWh"
  categories 2015 2016 2017 2018 2019 2020
  series "Coal" 40 38 35 30 26 22
  series "Gas" 25 27 29 31 33 34
  series "Renewables" 8 11 14 18 23 29
  layout stacked
}

OUTPUT
- Reply with one fenced code block and nothing else.
- The block starts with `area "…" {` 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.
How AI requests, attachments and privacy work

Something unclear? Contact support or read the Privacy Policy.