Variance chart reference
Contents: Use cases, Chart IDs, Minimal spec, Data, Options, Annotations, Sizing, Fixtures, Not for.
Variance tier vs PY/PL/FC: Δ columns, Δ% pins, or integrated good/bad caps on actuals. Type variance. Aliases: deviation.
Use cases
- Actual against plan or PY
- Variance in value and percent
- Budget deviation by cost center
Chart IDs
variance.absolute: fixturedpy-absolute-regionsvariance.relative: fixturedpl-relative-pinsvariance.integrated: fixtureintegrated-fc-caps
Minimal spec
{
"type": "variance",
"data": {
"categories": [{ "id": "north", "label": "North" }, { "id": "south", "label": "South" }],
"series": [
{ "id": "revenue", "label": "Revenue", "values": [120, 90], "scenario": "AC" },
{ "id": "plan", "label": "Plan", "values": [100, 100], "role": "reference", "scenario": "PL" }
]
},
"options": {
"variant": "absolute",
"variance": { "of": "revenue", "vs": "plan" },
"unit": "$k",
"title": "North exceeds plan by $20k; South misses by $10k",
"source": "Illustrative data",
"footnotes": ["AC = actual; PL = plan."]
}
}Data
A cell is a number, null or a value object; see Value cell.
| Path | Type | Required | Meaning |
|---|---|---|---|
| valueKind | string | Default valueKind for all series. One of 'fraction'. | |
| categories | array | yes | Ordered categories defining the displayed columns or positions and positional value alignment. |
| categories[].id | string | yes | Category identity used to match keyed values and annotation anchors. |
| categories[].label | string | Displayed category name; defaults to the category id and supports line breaks. A date id or date without a label prints a short date such as '4 Sep'. | |
| categories[].date | string | ISO 8601 category date; strictly increasing dates permit date-axis promotion where supported. | |
| categories[].footnote | integer | 1-based reference into options.footnotes. The number is drawn beside this category label as the reference mark, and the note it points at keeps that number; a reference to no note draws nothing and warns, and notes the engine derives print unnumbered. | |
| categories[].partial | boolean | Period still running. Actual columns, variance caps and absolute variance bars are hatched; relative pin heads are hollow. Marks keep their positions. The frame adds "<label> partial", and a drawn bar legend adds a hatch key. | |
| series | array | yes | Series supplying values for each category, with optional reference series for comparisons. |
| series[].valueKind | string | Multiply numbers by 100 into pct cells; explicit pct cells stay in percent units. One of 'fraction'. | |
| series[].id | string | yes | Series identity used by keyed options, annotations and legend entries. |
| series[].label | string | Displayed series name; defaults to the series id. | |
| series[].values | (cell | { categoryId, value: cell })[] | yes | Values in category order, or keyed entries pairing a categoryId with its value. |
| series[].scenario | string | AC, PY, PL, FC (or ACT, BUD, FCST, LY for last year). Codes and aliases accept any case. Read only on the variance.vs series, where it names the tier (ΔPL). Every data value draws as the actual, so name a forecast or plan value in its category label or a footnote. In a grid tier, a category whose values are all FC draws hatched, like a partial one. | |
| series[].direction | string | Whether increases are favorable; defaults to higherIsBetter for directional comparisons. One of 'higherIsBetter', 'lowerIsBetter'. | |
| series[].role | string | Data series or comparison-only reference series; references are excluded from the main plotted data. One of 'data', 'reference'. | |
| series[].colorRole | string | Theme color role of the integrated actual columns and their key when this series is the actual and sets no fill; no effect in the other modes or on a reference series. One of good, bad, warn, neutral, neutralLight, highlight, total, others; series-N for step N of the theme ramp, 1-based (series-2 is color.series[1]); or status-<key> for a theme status color. A hex color goes in fill. | |
| series[].fill | string | CSS fill of the integrated actual columns and their key when this series is the actual; a cell fill wins. No effect in the other modes or on a reference series. | |
| series[].unit | string | Unit of this series' values, read by the grid shared-scale check and the hover card; the drawn labels print options.unit. | |
| series[].format | string | Format-by-example for this series values, for example 1,234 or 1.2%. |
Options
| Path | Type | Values | Default | Meaning |
|---|---|---|---|---|
| sort | object | string | true | 'sheet', 'asc', 'desc', 'reverse', true (or another value of its type) | Category ranking value: the signed drawn difference, delta percent in relative mode and absolute difference otherwise. desc puts the largest positive difference first, asc the smallest; stable ties and missing values last. sheet keeps authored order and reverse reverses it. Dated categories keep authored order when a growth or difference annotation spans periods. | |
| topN | object | integer | Keep the n largest drawn differences by absolute size, delta percent in relative mode and absolute difference otherwise, before sorting. Missing differences count as zero. No Others row is drawn; omitted category names are disclosed. Authored rest: true, restLabel or showRestCount warns that it is ignored when categories are omitted. threshold is always ignored with an option-ignored warning. | ||
| axisTitles | object | Title of the value axis when it is drawn: over the value axis, in the top row left of the plot, when valueAxis.show draws it. Drawn only when authored. | ||
| axisTitles.primary | string | 'Measure, unit' title of the value axis, e.g. 'Margin, %'. | ||
| variant | string | 'absolute', 'relative', 'integrated' | Show raw differences, relative percentage differences, or an integrated comparison with the absolute values. The key builds its entries from the scenario code of the variance.vs series (AC, PY, PL or FC), or from its label when it has no scenario, here PY. absolute and relative: 'Better than PY' and 'Worse than PY', with (lower) and (higher) for a lowerIsBetter series. integrated: the compared series, then 'Above PY' and 'Below PY' for the caps, the same wording at every width, and 'Within rounding of PY' for a muted cap that prints as zero. On report, dashboard, slide and print, the actual value label sits inside the column at its foot; a column too short for it uses the actual edge, then a side position at the same height. | |
| variance | object | Required comparison identifying the measured quantity and the reference series. | ||
| variance.of | string | 'total' (or another value of its type) | Compared series id, or total for the sum of data series. Defaults to total. | |
| variance.vs | string | Reference-series id; its scenario names the comparison tier. | ||
| missingMark | string | 'dash', 'none' | What a category with no prior value leaves behind. 'dash' prints an en dash in the muted ink, at the baseline or, over an integrated actual column, where the cap would sit, so a missing reference reads as missing and not as no difference; 'none' (the default) draws nothing. A reference that exists and is not positive keeps its own 'n.m.' glyph. A category with a blank part in its actual total leaves the same mark and the info warning missing-value. |
Plus the shared options. This type does not accept detailFields, valueAxis.log, valueAxis.reverse, valueAxis.break, hatchStrength, rounding. This type ignores animate, debug, rowLabels, categoryAxis, categoryLabels, secondaryAxis, topN.threshold with an option-ignored warning.
Annotations
An annotation anchor is a category or item id string, or an object with categoryId plus optional seriesId, segmentId and edge (start, end, total); pointId addresses a scatter point. Category anchors, including from/to, take category ids, not category labels.
| Kind | Purpose | Required | Anchors | Optional fields | Notes |
|---|---|---|---|---|---|
| cagr | Draws a growth arrow between two anchored points and computes the compound annual growth rate from their values and ISO-date span. | from: AnchorRef (optional); to: AnchorRef (optional) | suffix: string, default 'p.a.'. Text after the rate. period: boolean. Print the period before the rate from the anchors' category labels, '2014–2019: +5.8% p.a.'. Default true when the chart carries two or more CAGRs, so nested brackets are told apart by their text, false otherwise. An arrow's ends show its span, so an arrow prints the rate alone unless period is true. shape: bracket | arrow, default bracket. arrow draws one straight arrow over the marks with the rate in an oval on it, lifted until it clears them. Where no straight line clears the chart, the span is too short for the oval, a stack's inner layer is the anchor or the chart lays comparisons out itself, it draws the bracket and warns cagr-arrow-no-room. | Omitted endpoints span the first to the last category, or the first to the last total on a waterfall. Resolved endpoints need a positive date interval from ISO dates or year-bearing labels and a positive start value; an end of zero reads -100%, and a start at or below zero or a negative end omits the rate and warns cagr-undefined. On a continuous time axis the years are the exact span between the two readings. An anchor on one series of several (seriesId, or a category of an unstacked line, which reads the first drawn series; on a stack a category reads the stack total) names that series in the label, "Product B +10.1% p.a.", and the arm runs from that series' segment or point. In text, ${value} prints the rate with its suffix, so "CAGR 2014–2019: ${value}" keeps the computed number. | |
| diff | Draws a level-difference arrow between two anchors and computes either percent change or their signed value difference. | from, to | from: AnchorRef; to: AnchorRef | mode: relative | absolute | reversed | both, default relative. relative prints the percent change from 'from' to 'to', reversed the change from 'to' to 'from', absolute the value difference, both the value difference with the percent change beside it. | Mode defaults to relative. Relative and reversed changes need a nonzero base; negative bases use its absolute magnitude and emit a warning. Absolute mode reports the raw value difference. A hidden label removes its arm. |
| delta | Computes the signed difference between an anchored value and another anchor or literal, then places a collision-managed label at the first anchor. | at, vs | at: AnchorRef; vs: AnchorRef | number | mode: absolute | relative | both, default absolute. absolute prints at minus vs, relative the percent change from vs to at, both the two as '+149 (+36%)'. relative and both need a nonzero vs. | |
| abs | Reads the anchored data value and places its formatted absolute value in a collision-managed label. | at | at: AnchorRef | ||
| note | Places authored text at an anchored data element through collision avoidance, with an optional icon or status chip. | at, text | at: AnchorRef | ||
| callout | Places authored free text at an anchored data element, routing a leader when displaced and honoring the preferred side. | at, text | at: AnchorRef | preferSide: left | right | above | below. Side the solver tries first; the label keeps a leader when it moves. headline: string. A bold first line over the text, which then prints in plain type; ${value} in it prints the anchored value from the data. Example: "headline": "${value}", "text": "Peak in handheld-loom demand" prints 153 in bold over the words. arrow: boolean, default false. An arrow from the text to the anchored point, in the arrow standard of theme marks.arrow: the text stands far enough out for a 24 px shaft, level with the point right or left of it, or over or under it, where there is room. With no such seat it draws without the arrow and warns callout-arrow-no-room. Not with icon or status. Example: "arrow": true. | |
| valueLine | Draws a reference line at an authored value or an engine-computed mean, with optional tolerance shading and attainment fill between the line and resolved actuals. | from: categoryId (optional); to: categoryId (optional) | value: number | 'mean', default mean. A number draws the line there; mean has the engine compute it. valueKind: 'fraction'. Multiply a numeric value and its tolerance by 100 before layout: 0.35 draws at 35%. Independent of data.valueKind. Omit it for values already in percent points; not valid with mean. label: string | false. Name plus value; ${value} sets its position. A number already in the name is kept once. false hides it. side: left | right, default right. Side of the plot the label sits on. tolerance: number | { low, high }. A number shades that distance on both sides of the line; low and high shade an authored corridor. On column, bar and dot the key names the band with its bounds, "Target range: 95 to 105"; without a key the band prints its bounds itself. | No anchor is required. Value defaults to mean. Scoped means are line-only: seriesId and paired from/to compute a primary-axis mean and limit its stroke to those bands; other types refuse scope fields for a mean. Numeric values cannot use scope fields except as a category clip with tolerance or attainment. A secondary-axis line needs an acknowledged secondary scale and an explicit numeric value. Optional tolerance shades a value-axis band; optional attainment fills between the line and resolved actuals. | |
| text | Places authored text at a point through the label solver: on the point, or above, below, right or left of it. The text prints as written. | at, text | at: AnchorRef | { categoryId, value } | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. The text prints as written, ${value} included. It takes id and priority, and no other field. | |
| line | Draws a straight line between two points or from a text annotation, in the ink and rule width of a bracket; a stretch that would cross text is cut. | from, to | from: AnchorRef | { categoryId, value } | { annotationId }; to: AnchorRef | { categoryId, value } | { annotationId } | dashed: boolean, default false. Draws the line in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. An end { annotationId } names a text annotation: the line starts or ends at the nearest edge of that text, at every size, and is not drawn when the text is not. A { categoryId, value } end stands on the category's center. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
| arrow | Draws a straight arrow between two points or from a text annotation to a point, in the theme arrow look (marks.arrow); a stretch that would cross text is cut. | from, to | from: AnchorRef | { categoryId, value } | { annotationId }; to: AnchorRef | { categoryId, value } | { annotationId } | dashed: boolean, default false. Draws the shaft in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. An end { annotationId } names a text annotation: the arrow starts or ends at the nearest edge of that text, at every size, and is not drawn when the text is not. A { categoryId, value } end stands on the category's center. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
| box | Draws an unfilled box with two points as opposite corners, wrapping whole category bands, in the ink and rule width of a bracket; text inside the box stays free. | from, to | from: AnchorRef | { categoryId, value }; to: AnchorRef | { categoryId, value } | dashed: boolean, default false. Draws the edges in the dash of a reference line. | A point is an anchor or { categoryId, value } with value in axis units. A value outside the plot, a chart with no value scale or an anchor that does not resolve warns bad-anchor and draws nothing; the axis does not grow. from and to are opposite corners, the box has no fill, and text inside it stays free. A { categoryId, value } corner spans that category's whole band, so the box wraps whole bars, values and markers; from and to on one category wrap that category. A stretch that would cross text is cut and warns draw-crosses-text. It takes dashed and id, and no other field. |
Sizing
Floor 280 × 270 px; fit fill. Below 270 px high, down to the compact floor of 280 × 180 px, the chart draws in compact mode; belowMinimum: 'refuse' refuses there instead.
Below the floor a render is refused with size-below-floor and the pixels it needs. measure returns the natural and comfortable size for a given spec; see Sizing in the manual.
Fixtures
| ID | Kind | Use case |
|---|---|---|
| dpy-absolute-regions | example | ΔPY absolute variance columns with forced signs |
| dpl-relative-pins | example | ΔPL% relative variance pins, ≤1 decimal, forced signs |
| integrated-fc-caps | example | Integrated variance: AC columns with ΔFC caps |
| integrated-solid-shortfall | example | Integrated variance with a solid shortfall cap (surface.shortfallCap) |
| ref-nonpositive-suppression | torture | Torture: REF zero and negative suppress Δ% with warnings |
| all-positive-deltas | torture | Total SaaS and services revenue growth by region versus prior year |
| all-negative-deltas | torture | Torture: all-negative ΔPL, labels mirrored below, category labels in one row under the bars |
| lower-is-better-costs | torture | Torture: lowerIsBetter cost series inverts good/bad tones |
| twelve-months-dense | torture | Torture: 12 monthly categories, mixed signs, smart density |
| annual-surplus | example | Over-plan volume grows 20% a year |
| annual-relative-surplus | example | The percentage gap above plan grows 20% a year |
| torture-long-labels | torture | Torture: long names at a generous size read whole, never cut |
| missing-prior-dash | example | A market with no prior year prints an en dash, not an empty slot |
| authored-relative-decimals | torture | Relative changes retain the authored precision |
| partial-period | example | A running month hatches both the actual and its variance cap |
| absolute-centered-values | example | Absolute variance values at the center |
| integrated-centered-values | example | Integrated totals on one paint |
Not for
Relative variance against a zero or negative reference.