Skip to documentation content

Documentation · Data

Line chart

Name the readings along the axis, then one series per line you want drawn. Everything here is also a control in the Chart panel.

Open Line chart

When to use it

Show a run of values over ordered categories or compare several runs on the same axis.

Keep category order meaningful. Every series must align with the categories it shares; a line is not a scatter plot of independent x/y pairs.

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
line "Wildlife Population" {
  y "Animals counted"
  legend bottom

  categories 2017 2018 2019 2020 2021 2022
  series "Bears" 8 55 92 116 137 184
  series "Dolphins" 150 77 34 12 5 2
  series "Whales" 80 54 100 76 93 72
}

Syntax reference

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

Chart

SyntaxMeaning
line "Title" {open a line chart

Readings

SyntaxMeaning
2017 8one reading, named and measured
categories 2017 2018name the readings along the axis
series "Bears" 8 55 92one line across those categories
series "B" "#2a78d6" 8 55a line in a colour of its own

Line

SyntaxMeaning
markers ona dot at every reading
curve onjoin the readings with a curve
area onwash the space under the line

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 line "Title" { ... } block. Nothing may sit outside it.
  • A reading is Name 40, one per line, and draws a line 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 reading dots on the canvas or change values through the chart panel.
  • Choose line shape, markers, area wash, axes and legend in the chart controls.

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

SYNTAX
Chart
  line "Title" {              open a line chart

Readings
  2017 8                      one reading, named and measured
  categories 2017 2018        name the readings along the axis
  series "Bears" 8 55 92      one line across those categories
  series "B" "#2a78d6" 8 55   a line in a colour of its own

Line
  markers on                  a dot at every reading
  curve on                    join the readings with a curve
  area on                     wash the space under the line

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 `line "Title" { ... }` block. Nothing may sit outside it.
- A reading is `Name 40`, one per line, and draws a line 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
line "Wildlife Population" {
  y "Animals counted"
  legend bottom

  categories 2017 2018 2019 2020 2021 2022
  series "Bears" 8 55 92 116 137 184
  series "Dolphins" 150 77 34 12 5 2
  series "Whales" 80 54 100 76 93 72
}

OUTPUT
- Reply with one fenced code block and nothing else.
- The block starts with `line "…" {` 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.