# BI Components 1.4.0: tags and attributes
A dashboard is HTML with these tags. Close every tag: , never .
Without table, measure and by are names the server knows. With table="...", they are SQL expressions.
Clicking a bar, a point, a slice or a table row filters the other components: nothing to code.
## Shared attributes
- table: The table to query. Its presence selects SQL expressions: measure and by are then SQL, computed by the database.
- measure: What to compute, one only: the name of a measure, or with table an SQL aggregate such as sum(revenue). "sum(revenue) as Revenue" names it.
- by: The dimension to split by. Clicking one of its values filters the other components.
- sort-by: A measure or a dimension, with an optional direction: sort-by="revenue desc".
- limit: The number of rows.
- format: eur, pct, int or dec, or a spreadsheet pattern such as #,##0.
- title: A title above the component.
- where: An SQL condition for this component only. Refused in a sandboxed dashboard. Only with table.
- date-column: The column the period of the page applies to, when it is not the one of the table. Only with table.
- granularity (day | week | month | quarter | year | auto): A time series, with no by. Without a value (or "auto"), follows the date_granularity option of the page. Only without table.
- compare (yoy | mom | prev_period | auto): A comparison with another period. Without a value (or "auto"), follows the period_comparison_method option of the page. Only without table.
- height: The height of the chart (400px).
- hide-axis-names: No name on the axes.
- param-*: Anything else the server understands: param-scope="like_for_like" travels as params.scope in the query.
## Charts
: Compares a measure across the values of a dimension.
Shared attributes: table, measure, by, sort-by, limit, format, title, where, date-column, granularity, compare, height, hide-axis-names.
- breakdown-by: A second dimension: one series per value.
- breakdown-limit: With breakdown-by: how many series to keep, the biggest first (6). Only with table.
- stacked: With breakdown-by: the series are added up.
- horizontal: Horizontal bars: a ranking, the biggest values first.
: A trend over time.
Shared attributes: table, measure, by, sort-by, limit, format, title, where, date-column, granularity, compare, height, hide-axis-names.
- breakdown-by: A second dimension: one series per value.
- breakdown-limit: With breakdown-by: how many series to keep, the biggest first (6). Only with table.
- stacked: With breakdown-by: the series are added up.
: The share of each value of a dimension.
Shared attributes: table, measure, by, sort-by, limit, format, title, where, date-column, granularity, compare, height, hide-axis-names.
: A pie chart with a hole.
Shared attributes: table, measure, by, sort-by, limit, format, title, where, date-column, granularity, compare, height, hide-axis-names.
## Key figures
: A key figure with its title and, with compare, its variation.
Shared attributes: table, measure, by, sort-by, limit, format, title, where, date-column, granularity, compare.
: A value alone, to put in a sentence.
Shared attributes: table, measure, by, sort-by, limit, format, title, where, date-column, granularity, compare.
## Tables
: A table: dimensions, attributes, then measures. A click on a header sorts, a click on a row filters.
Shared attributes: table, measure, sort-by, limit, format, title, where, date-column, granularity, compare.
- by: One or several dimensions: by="country, channel". A click on a row filters on the first.
- measures: Several measures, separated by commas.
- attributes: Columns that describe a dimension: attributes="city, manager".
- formats: A format per column: formats="revenue:eur, orders:int".
- max-height: The height from which the table scrolls, under a fixed header.
## Filters
: The period of the page: presets and two dates.
- presets: Among all, 7d, 30d, 90d, 365d (any number of days), mtd and ytd.
- max: The last day of the presets, when it is not today: YYYY-MM-DD.
- default: The period at start: a preset, or two dates separated by a comma.
: A filter on a dimension, or a switch for an option of the page.
- dimension: The dimension to filter on.
- option: Instead of dimension: the option of the page this control drives, such as date_granularity or a business switch the server reads.
- type (select | segmented | toggle): A list (default), buttons or a checkbox.
- options: The choices: options="Web, Store", or with labels options="web:Online, store:In store". Without it, the values are read from the data.
- table: Where to read the values, with SQL expressions.
- label: The text before the control. label="" for none.
- multiple: A list that takes several values.
- value: For a toggle on a dimension: the value it filters on.
- default: The selection at start: default="Web", default="Web, Store".
## Data sources
: Static page: a file queried in the browser, used as table="name".
- name: The name components use in table="...".
- url: A Parquet, CSV or JSON file, or an API that returns JSON.
- columns: The columns to keep or compute, as in an SQL select. * by default.
- date-column: The column the period of the page applies to.
- format (parquet | csv | tsv | json): When the address does not end with it.
select store, sum(revenue) as revenue from orders group by 1
: Static page: an SQL query on the source tables, used as table="name".
- name: The name components use in table="...".
- date-column: The column the period of the page applies to.
: Your backend: the queries of the page go to this address, one POST per batch.
- url: Where the queries go, relative to the page.
- body: A JSON object added to every request.
- credentials (same-origin | include | omit): same-origin (default), or include for an API on another site.
## Explore a table
: One bar chart per dimension, to explore a table.
Shared attributes: table, measure, sort-by, limit, format, where, date-column, compare.
- by: The dimensions, one chart each. With table and without by: every text column.
- time-by: One line chart per value: a time column with table, a granularity without.
- horizontal: Horizontal bars: a ranking, the biggest values first.
: Static page: the tables of the page.
: Static page: the columns of a table and their types.
Shared attributes: table.