For the complete documentation index, see llms.txt. This page is also available as Markdown.

Dashboard

The dashboard object: scopes, sections, cards, charts, filters, and transformations.

Your goal

Understand the dashboard structure well enough to lay one out deliberately - and to work in advanced mode when the interface cannot do what you need.

The object model

A dashboard is a DashboardRegistration: a title, scopes, and a DashboardContent. The content is composed of sections and cards, and cards organise charts.

Scopes: where a dashboard appears

Scope
Where it displays

home

The datamart's home page.

segments

The segments page - all segments, or a specific set with segment IDs in segment_ids.

builders

Standard segment builders - all of them, or a specific set with builder IDs in builder_ids.

You can have several dashboards at the same scope. When you do, tabs are created to switch between them; with a single dashboard there are no tabs.

Sections and cards

Each section has a title and cards arranged on a grid. Each card is a white block organising charts horizontally or vertically.

The grid is 12 columns wide, with as many rows as needed. Size and position come from these properties:

Property
Meaning

h

The number of rows the card takes.

w

The number of columns the card takes.

x, y

The coordinates of the card's top-left corner on the grid.

So a full-width card is w: 12, and two side-by-side cards are w: 6 with x: 0 and x: 6.

Charts

Each chart has a title, a type, a dataset, and optionally colours and options.

Field
Notes

title

Can be an empty string.

type

Bars, Pie, Metric, or Radar.

dataset

The data source - an OTQL query referenced by query_id, or an activities analytics query.

options

Depends on the chart type.

A chart's dataset references a saved query by ID, which is why the Query API asks you to save queries. See Query API.

Options for a Bars chart

Area, Pie, Metric, and Radar charts have their own option sets, following the same pattern.

Working in advanced mode

1

Save the query as a technical query

Run it in the Query Tool and save it as a technical query. Note the query ID.

2

Open the dashboard

In Computing Console, go to Dashboards and add or edit a dashboard. Choose a name and save.

3

Switch to the Advanced tab

Edit the JSON - the whole DashboardContent for the dashboard, or a single chart from that chart's own advanced tab, where you can preview your changes.

Filters

A dashboard can have filters in the top action bar - a compartment or channel selector, for example. The user picks a value and every query in the dashboard adapts to it.

Filters can only be set up in advanced mode, through the available_filters property of the DashboardContent.

Note the asymmetry: a chart dataset references a saved query by ID, while a filter takes a query string.

Transformations

Transformations reshape a dataset before it is charted. The available ones:

Transformation
What it does

to-list

Turns a result into a list.

join

Combines datasets.

to-percentages

Converts values to percentages.

ratio

Calculates a ratio between values.

index

Produces an index - the basis of audience comparison charts.

format-dates

Formats date keys.

reduce

Reduces a series to a single value - for instance to display a @cardinality query as a metric.

get-decorators

Resolves schema decorators so labels read properly.

Worked uses are in Dashboard cookbook.

Last updated

Was this helpful?