Skip to documentation content

Documentation · Data

Bar chart

Write the readings one to a line, then any settings you want. Everything here is also a control in the Chart panel, and the two always agree.

Open Bar chart

When to use it

Compare categorical readings, including grouped or stacked series.

Use one reading per line for a single series. Use categories and series together when you are comparing multiple measurements.

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
bar "Favourite Fruit" {
  x "Favourite fruit"
  y "Number of students"

  Apples 9
  Bananas 16
  Oranges 10
  Grapes 7
}

Syntax reference

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

Chart

SyntaxMeaning
bar "Title" {open a bar chart; close it with }

Readings

SyntaxMeaning
Apples 40one bar, named and measured
"Two words" 40a name with a space goes in quotes
categories A B Cname the bars, for grouped series
series "Round 1" 10 20 12one series across those categories
series "R1" "#e34948" 10 20a series in a colour of its own

Bars

SyntaxMeaning
bars horizontalvertical or horizontal
layout stackedgrouped or stacked, for several series

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 bar "Title" { ... } block. Nothing may sit outside it.
  • A reading is Name 40, one per line, and draws a bar 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 a bar's end to change its reading; use the chart panel to edit categories, series and values.
  • Choose orientation, grouping, labels and axes 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 bar chart. Answer with Tingraph source only.

SYNTAX
Chart
  bar "Title" {               open a bar chart; close it with }

Readings
  Apples 40                   one bar, named and measured
  "Two words" 40              a name with a space goes in quotes
  categories A B C            name the bars, for grouped series
  series "Round 1" 10 20 12   one series across those categories
  series "R1" "#e34948" 10 20  a series in a colour of its own

Bars
  bars horizontal             vertical or horizontal
  layout stacked              grouped or stacked, for several series

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 `bar "Title" { ... }` block. Nothing may sit outside it.
- A reading is `Name 40`, one per line, and draws a bar 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
bar "Favourite Fruit" {
  x "Favourite fruit"
  y "Number of students"

  Apples 9
  Bananas 16
  Oranges 10
  Grapes 7
}

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