Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Charts

The Chart tab of the results pane draws the rows a result has fetched as vertical bars, horizontal bars or lines (in braille dots). Open it with c in the grid, Space r c, its tab in the strip, or the action menu. Nothing is asked of the server and nothing runs again; nothing is read for a chart until its tab is viewed.

╭ Explorer ──────────────────╮ 1 console 1 ×
│  + New connection         │╭ Query · console 1 ─────────────────────────────────────────────────────────────────────╮
│▾ Connections 1             ││ local-pg / datarig  127.0.0.1:55432                        Space c s switch connection │
│  ▾ ●   local-pg            ││  1 -- datarig 🐘  Ctrl+E: run the statement under the cursor                           │
│    ▾ datarig default       ││  2▎SELECT * FROM shop.users WHERE id <= 8;                                             │
│      ▸ analytics           ││  3                                                                                     │
│      ▸ public              ││  4 SELECT u.name, o.status, o.total_amount                                             │
│      ▸ shop                ││  5 FROM shop.orders o                                                                  │
│                            ││  6 JOIN shop.users u ON u.id = o.user_id                                               │
│                            ││  7 WHERE o.status = 'paid';                                                            │
│                            ││  8                                                                                     │
│                            ││  9 SELECT * FROM analytics.events;                                                     │
│                            ││ 10                                                                                     │
│                            │╰────────────────────────────────────────────────────────────────────────────────────────╯
│                            │╭ Chart · Bars ──────────────────────────────────────────────────────────────────────────╮
│                            ││ Result 1  [Chart]  Messages                                                        H/L │
│                            ││ [Bars]  Horizontal bars   Line              first 30 fetched rows · more on the server │
│                            ││ X day · Y orders, refunds · by none · linear scale                                     │
│                            ││ 100┤                     ▃                                ▆                            │
│                            ││    │            ▃        █                       ▆        █                       █    │
│                            ││    │   ▃        █        █              ▆        █        █              █        █    │
│                            ││    │   █        █        █     ▆        █        █        █     █        █        █    │
│                            ││  50┤   █        █     ▆  █     █        █        █     █  █     █        █     ▂  █    │
│                            ││    │   █     ▆  █     █▁ █     █   ▂    █     █▄ █     █  █▆    █     ▂▇ █     █  █    │
│                            ││    │▆  █   ▇ █  █     ██ █     █   █ █  █   ▂ ██ █     █▃ ██ ▂  █   ▅ ██ █     █▆ █    │
│                            ││    │█  █▅  █ █  █   ▆ ██ █  █  ██  █ █  █   █ ██ █  ▂▁ ██ ██ █  █▂  █ ██ █   ▄ ██ █    │
│                            ││    │█▂ ██  █ █  █▄ ██ ██ █  █▆ ██  █ █  █▇ ▂█ ██ █  ██ ██ ██ █  ██  █ ██ █▂ ▅█ ██ █    │
│                            ││   0┤██ ██ ██ █▂ ██ ██ ██ █▃ ██ ██ ▂█ █▅ ██ ██ ██ █▆ ██ ██ ██ ██ ██ ▅█ ██ ██ ██ ██ █▁   │
│                            ││    └────────────────────────────────────────────────────────────────────────────────── │
│                            ││     2026-09-01  2026-09-05  2026-09-09  2026-09-13  2026-09-17  2026-09-21  2026-09-2› │
│                            ││ ■ orders  ■ refunds                                                                    │
│                            ││ ▸ 2026-09-01 · orders 37 · refunds 13 · row 1                                          │
╰────────────────────────────╯╰────────────────────────────────────────────────────────────────────────────────────────╯
 NORMAL  local-pg │ 30+ rows (more pages) · 3ms             │ v kind · x X · s values · y copy · c rows · : commands EN

What it draws

The chart picks its columns at first sight:

  • a date or time column and numbers: lines over time;
  • a text column and numbers: bars (horizontal with more than 12 of them or labels longer than 12 characters);
  • two or more numbers alone: lines over the first one; a single number alone: bars (lines past 40 rows).

Several number columns are several series, and one number with a text column of 2 to 10 values (in the first 500 rows) gives a series per value. The chart says how many fetched rows it draws and whether the server has more: fetch more pages first to chart them.

  • Rows with the same X are summed.
  • NULLs are skipped and counted under the chart.
  • More than 50 bars or 6 series keep the largest and sum the rest into “others”.
  • A result without rows or numbers, or with a single point, says why instead of drawing.
  • A result with pending or applied changes draws nothing until the query runs again: see Editing data.

Keys

KeysWhat they do
v / V, 1 2 3The kind: bars, horizontal bars, line
xChoose the X column
sChoose the value columns
bA column that splits the values into series
SLogarithmic scale on or off
arrows, h j k lMove a cursor over the bars or points, showing the exact values and their row
EnterShow that row in the grid
y / YCopy the chart’s numbers as TSV / the drawing as text
cBack to the rows

The mouse works too: a click picks a point, a kind or a column choice.

The series’ colours are the theme tokens chart_1 to chart_6 (see theme files).

Not supported: writing the SQL of a chart into a console.