show
show, keyword
Displays a dashboard tile. Every script must emit at least one tile.
Syntax overview
The general shape of a show statement is:
show table "my title" a1c2 slices: SX { tileColor: tomato; backgroundColor: "#fdad31" } with
Items.Category as "My category"
Items.Supplier as "My supplier"
sum(Items.StockOnHand) as "Stock on hand"
sum(Items.StockOnHand * Items.BuyPrice) as "Stock value"
group by [Items.Category, Items.Supplier]
order by [Items.Category, sum(Items.StockOnHand * Items.BuyPrice)] desc
The elements that compose a tile are:
- a tile type (for example
tableorscalar). - a tile title (a scalar text value).
- an optional placement, either legacy Excel-like coordinates such as
a1c2or a placement block in StyleCode. See region for the grid placement rules. - an optional
slices:option when the dashboard is sliced (see slices). - an optional StyleCode block (see stylecode).
Grouping and ordering
The expressions passed after with are aligned into a table for the tile. You can add group by and order by statements at the end of that list:
group byapplies the same grouping to all fields; expressions must use aggregators likesumoravg.order bysorts the resulting rows;descreverses the ordering for that expression.
show table "my table" with
T.X
T.Y
T.Z
order by [T.X desc, T.Y]
Envision also offers a concise inline form for simple tiles:
show table "my table" with T.X, T.Y, T.Z
Example
table Sales = with
[| as Region, as Units |]
[| "Europe", 100 |]
[| "Europe", 125 |]
[| "North America", 1000 |]
[| "North America", 75 |]
show label "Sales demo"
show scalar "Total units" with sum(Sales.Units)
show table "Units by region" with
Sales.Region
sum(Sales.Units) as "Units"
group by Sales.Region
show barchart "Units by region" with
sum(Sales.Units) as "Units"
group by Sales.Region
The show table tile renders:
| Region | Units |
|---|---|
| Europe | 225 |
| North America | 1075 |
Remarks
The tile type (such as scalar or table) controls how vectors are rendered.
The tile title must be a scalar text value and can be computed.
The with block is required for all tile types except label.
See also
Below is the complete list of tile types supported by Envision:
- assert – mark a run as failed if certain conditions are not met with the data.
- barchart – display data in a bar chart.
- chart – display data as a series of internal tiles.
- form – display a form where values can be manually entered from the dashboard view.
- file – display the contents of an Ionic file stored in BigFiles.
- gauge – display a single numeric value on a gauge.
- histogram – display data in a histogram.
- image – display an image from a URL.
- label – display a short piece of text within the dashboard.
- linechart – display a daily, weekly and monthly time-series.
- markdown – display Markdown text.
- piechart – display data in a pie chart.
- plot – display a function f(x)=y.
- scalar – display a table with only a single line.
- scatter – display a set of 2D points.
- slicepicker – display an interactive tile with navigation controls.
- slicetree – display an interactive tile with navigation controls and an arbitrary number of hierarchical levels.
- summary – display a list of scalar values (such as KPI).
- table – display data in a tabular format.
- tabs – display a tab selector between two or more tabs.
- treemap – display data table as a two-dimensional map.
- upload – upload files directly from an Envision dashboard.