KDB knowledge

Dashboard page (many charts on one page)

Put many charts on one page, each from its own query, with pickers such as $symbol at the top and an automatic refresh. Dashboards are saved in the database.

The Dashboard page of the web console (Home menu) shows many charts on one page. Each chart is a panel: one SELECT and the chart settings for it. The panels refresh by themselves, and pickers at the top (a symbol, a date range) change every panel at once.

The screen

+---------------------------------------------------------------------------------------------+
| [Stock view v] [Stock view        ]          Auto refresh [30 s v] Refresh Edit Add panel Variables Save More |
| Symbol [CITY v]   From [2025-09-23]   To [2026-09-23]                                        |
| +------------------------------------------------------------+                              |
| | Candles, volume, RSI and MACD                          ... |                              |
| |  (chart)                                                   |                              |
| +------------------------------------------------------------+                              |
| +------------------+ +---------------------------------------+                              |
| | Last close   ... | | Daily move % (calendar)           ... |                              |
+---------------------------------------------------------------------------------------------+
ControlWhat it does
Dashboard listOpens another dashboard: yours, then the examples
Title boxThe dashboard's name
Auto refreshRuns every panel again every 5 s, 10 s, 30 s, 1 min, 5 min or 15 min, or Off
RefreshRuns every panel again now
EditTurns on moving and resizing panels
Add panelOpens the panel editor for a new panel
VariablesThe pickers at the top (variables)
SaveWrites the dashboard to _dashboards
MoreNew dashboard, Duplicate, Export JSON file, Copy JSON, Import JSON, Delete

The panels sit on a grid of 12 columns. In Edit mode, drag a panel by its move handle, or drag its bottom right corner to resize it. With the keyboard: arrow keys move it, Shift + arrow keys resize it.

Panels

Each panel has a ... menu:

ItemWhat it does
EditOpens the panel editor
RefreshRuns this panel again
Open SQL in editorPuts the panel's SQL, with the variables filled in, into the SQL editor on Home
Save PNG, Save CSVThe chart as a picture, or its rows as a CSV file
Full screen, Reset zoomAs on the chart of the SQL editor
DuplicateA copy of the panel
RemoveTakes the panel off (in Edit mode only)

The panel editor has a title, a kind and, for a chart, the SQL. Chart from SQL is one SELECT and a chart; Text note is a few lines of text, for example how to use the dashboard. Run preview (or Ctrl+Enter) runs the SQL and shows the chart, with the same chart types and settings as the SQL editor.

The quickest way to make a panel: run a query on Home, pick a chart, and click Add to dashboard on the chart bar.

Example: A good panel query: one symbol, a time range (sample data: sample)

SELECT time, open, high, low, close, volume
FROM ochl_day
WHERE symbol = 'CITY'
ORDER BY time;

Result:

time (TIMESTAMP)open (DOUBLE)high (DOUBLE)low (DOUBLE)close (DOUBLE)volume (DOUBLE)
2025-12-28T00:00:00.000Z540.3542.5539.2542.285290
2025-12-29T00:00:00.000Z540.6542.1538.8539.752010
2025-12-30T00:00:00.000Z538.5540.5536.4539.395460
2025-12-31T00:00:00.000Z540.4546.2538.9542.422330
2026-08-23T00:00:00.000Z505508.4502507.9125050

(first 5 of 19 rows)

Variables

A variable is a picker at the top of the dashboard. Write $name (or ${name}) in a panel's SQL and the picker's value goes there. Variables opens the list: a name, a label, a type and a default value.

TypeThe pickerGoes into the SQL as
Texta text boxa quoted text: 'CITY'
List of valuesa list of values you type (CITY, COAST, VOLT)a quoted text
Values from SQLa list filled by a query (SELECT DISTINCT symbol FROM ochl_day ORDER BY symbol)a quoted text
Numbera number boxthe number
Datea date box; the default may be today, today-30d, today-1ya quoted date: '2026-09-11'
Table or column namea text boxthe name as it is (letters, digits and _ only)
Intervala text box: 1d, 15m, 1Mas it is, for SAMPLE BY $step

Example: What a panel with $symbol, $from and $to runs (sample data: sample)

-- The panel SQL:  ... WHERE symbol = $symbol AND time >= $from AND time < $to
SELECT time, close
FROM ochl_day
WHERE symbol = 'CITY' AND time >= '2025-01-01' AND time < '2026-01-01'
ORDER BY time;

Result:

time (TIMESTAMP)close (DOUBLE)
2025-12-28T00:00:00.000Z542.2
2025-12-29T00:00:00.000Z539.7
2025-12-30T00:00:00.000Z539.3
2025-12-31T00:00:00.000Z542.4

(4 rows)

Saving, and who may do what

Role on the databaseCan
readopen and look at dashboards; export them as JSON
writealso save, change and delete them
adminalso save the first dashboard, which creates the table _dashboards

Example: The table the first Save creates

CREATE TABLE IF NOT EXISTS _dashboards (id STRING PRIMARY KEY, title STRING NOT NULL, body STRING NOT NULL, updated TIMESTAMP, updated_by STRING);
SHOW COLUMNS FROM _dashboards;

Result:

CREATE TABLE IF NOT EXISTS _dashboards (

table '_dashboards' created

SHOW COLUMNS FROM _dashboards

name (STRING)type (STRING)primary_key (BOOL)not_null (BOOL)computed (BOOL)references (STRING)
idSTRINGtruefalsefalseNULL
titleSTRINGfalsetruefalseNULL
bodySTRINGfalsetruefalseNULL
updatedTIMESTAMPfalsefalsefalseNULL
updated_bySTRINGfalsefalsefalseNULL

(5 rows)