Skip to documentation content

Documentation · Data

Histogram

Write one bin per line, in order along the axis, with the count that falls in it. The bars touch because the bins do.

Open Histogram

When to use it

Show how one measured quantity is distributed, as counts in touching bins of equal width.

Give every bin the same width and leave none out, even an empty one: the bars touch because the bins do. Use a bar chart instead for separate categories.

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
histogram "Exam Scores" {
  x "Score"
  y "Number of students"

  "40-50" 2
  "50-60" 5
  "60-70" 11
  "70-80" 14
  "80-90" 8
  "90-100" 3
}

Syntax reference

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

Chart

SyntaxMeaning
histogram "Title" {open a histogram; close it with }

Bins

SyntaxMeaning
"40-50" 2one bin and its count, in order along the axis
"<40" 1an open bin at either end

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 histogram "Title" { ... } block. Nothing may sit outside it.
  • A bin is its range in quotes and the count in it: "40-50" 2, one per line, in order along the axis.
  • Give every bin the same width and leave no gaps in the range; write an empty bin with a count of 0.
  • A histogram has one distribution: it takes no series, categories, bars or layout lines.
  • Settings are written as name value, in any order, before or after the bins.
  • Do not invent settings. Every one the language has is listed above.

Edit on the canvas

  • Drag a bar's top to change its count, or edit bins and counts in the chart panel.
  • Set axis titles, the value range, grid lines and colours 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 histogram. Answer with Tingraph source only.

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

Bins
  "40-50" 2                   one bin and its count, in order along the axis
  "<40" 1                     an open bin at either end

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 `histogram "Title" { ... }` block. Nothing may sit outside it.
- A bin is its range in quotes and the count in it: `"40-50" 2`, one per line, in order along the axis.
- Give every bin the same width and leave no gaps in the range; write an empty bin with a count of 0.
- A histogram has one distribution: it takes no `series`, `categories`, `bars` or `layout` lines.
- Settings are written as `name value`, in any order, before or after the bins.
- Do not invent settings. Every one the language has is listed above.

WORKED EXAMPLE
histogram "Exam Scores" {
  x "Score"
  y "Number of students"

  "40-50" 2
  "50-60" 5
  "60-70" 11
  "70-80" 14
  "80-90" 8
  "90-100" 3
}

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