See Getting started with dashboard commands for more information.
DISPLAY [AS BUNDLE|TABLE|PLOT]
With filtered, weighted values in hand we are ready to craft how to display them on a tile — in a table, bar plot, or other type of graph. Dashboard titles support several convenient “bundles” that correspond to what users think of as “chart types.” In the future, custom plots will be composable using a more general PLOT grammar. Bundle defaults (and options to deviate from the default) will be described in terms of the plot grammar and how they affect the scales, axes, and marks on the plot.
For example:
- DISPLAY AS <bundle name> VALUES <measure> <display bundle options>
- DISPLAY TABLE CELLS <measure> <display table options>
If left unspecified, the default display for both frequencies and crosstabs corresponds to a bar plot showing percentages (for one-way frequencies) or column percentages (for crosstabs). Adjacent columns of the table map to “groups” of bars of different colors within each band of a categorical Y axis taking its categories from the “rows” of the table. (The exact mapping of table row and column to category groups and colors can be confusing. Future releases may offer different ways to express some of the same concepts.)
Following the keyword for a bundle type is the VALUES to plot. Each bundle exposes one primary unbound aesthetic mapping of a named value available in or computable from the query result (percentages, for example, are computed from weighted frequency counts). The VALUES keyword specifies what measure to bind to that mapping. Some bundles expose a secondary mapping in options.
Every bundle has one and only one element which is drawn differently based on the values in the data. That one is the dimension that's different based on the values you send it. Every bundle has a variety of elements that are optionally configurable and one element that is required.
What data goes into the bundle?
Defined bundles
- HORIZONTAL BARS
- VERTICAL BARS
A vertical bar plot has a continuous X axis and categorical Y axis. Values represent the width of each bar. For a frequency plot, a color palette can redundantly map to the categories of the category axis. For a crosstab, a color palette maps to the categories of a second category axis coming from the BY variable in the query.
Vertical bar plots swap the position of the categorical axis to X and the continuous value axis to Y. The specified value is mapped to the height of each bar instead of the width. Vertical bar plots have a familiar appearance to many users, but they pose challenges when there are a large number of categories or when category labels are too long.
- POSITION DODGE|STACK
- DONUT
A donut plot is a single stacked bar in polar coordinates. It can only be used to represent frequencies, and should only be used for categorical frequencies (not multiple response). It has one category axis which maps to a color palette. Category arcs are placed “naturally” rather than mathematically: clockwise from an origin at the “top” (at 𝜏/4), rather than from origin 0 through 𝜏 or 2𝜋.
- TIMEPLOT
Display Syntax by display type
- DISPLAY AS BUNDLE
- VALUES measure <DIFFERENCES>
- DECIMALS <int> MOE <int> OTHER <int>
- ARRANGE grouped/stacked
- ANNOTATE VALUES
- ASPECT <int/Free>
- UNITS <int>
- INCLUDE EMPTY
- AXIS <CATEGORIES/VALUES> TITLE <label> SUBTITLE <label> RANGE <int/null> <int/null>
- PALETTE <label>
- DISPLAY TABLE
- CELLS <measure>
- MARGIN BOTTOM/RIGHT <marginal>
- DECIMALS <int> MOE <int> OTHER <int>
- COLOR CELLS Z_SCORE/REFERENCE COLUMN ELEMENT/INSERTION
- PALETTE <label>
- KPI <catxcat>
- UNITS <int>
- INCLUDE EMPTY
- SUMMARY ROWS <BASE_UNWEIGHTED, BASE_WEIGHTED>
- DISPLAY PLOT
- ENCODING+ COLOR/EXTEND/LABEL/X/Y = <measure>
- LAYERS+ LINE/RIBBON COLOR/EXTENT/LABEL/X/Y = <measure>
- AXIS <CATEGORIES/VALUES> TITLE <label> SUBTITLE <label> RANGE <int/null> <int/null>
- INCLUDE EMPTY
- PALETTE <label>
- ASPECT <int/free>