Likert chart reference
Contents: Use cases, Chart IDs, Minimal spec, Data, Options, Annotations, Sizing, Fixtures, Not for.
Agreement across statements as a diverging stacked bar centered on the declared neutral midpoint — shares, sign, segment order and net score all derived, and the neutral convention stated rather than assumed. Type likert. Aliases: diverging-stacked.
Use cases
- Agreement by statement
- Net sentiment per question
- Employee survey results
Chart IDs
One form; its chart ID is likert.
Minimal spec
{
"type": "likert",
"data": {
"scale": [
{ "id": "disagree", "label": "Disagree" },
{ "id": "neutral", "label": "Neutral", "role": "neutral" },
{ "id": "agree", "label": "Agree" }
],
"items": [
{ "id": "service", "label": "Helpful service", "values": [10, 20, 70] },
{ "id": "speed", "label": "Fast response", "values": [20, 30, 50] }
]
},
"options": {
"values": "counts",
"unit": "responses",
"title": "Helpful service receives more agreement than fast response",
"source": "Illustrative data"
}
}Data
| Path | Type | Required | Meaning |
|---|---|---|---|
| scale | array | yes | Response options ordered most-negative to most-positive. Fewer than three is refused AT LAYOUT with likert-scale-too-short, so the author gets the domain reason rather than a schema arity message. |
| scale[].id | string | yes | Response-option identity used by keyed statement values. |
| scale[].label | string | Displayed response-option name; defaults to its id. | |
| scale[].role | string | The midpoint of an ODD scale. Exactly one option carries it, in the middle position; an even scale must not carry it at all. One of 'neutral'. | |
| items | array | yes | Survey statements and their response distributions, displayed in input order unless sorting is requested. |
| items[].id | string | yes | Unique survey-statement identity. |
| items[].label | string | Displayed survey statement; defaults to its id. | |
| items[].date | string | ISO observation date for dated survey-wave comparisons; statement order does not supply a period. | |
| items[].values | array | yes | Counts or percentages per DECLARED scale option, positional or keyed. Which of the two is declared by options.values and is never inferred. |
| items[].values[].optionId | string | yes | Declared scale-option id receiving this response value. |
| items[].values[].value | number | null | yes | Count or percentage according to options.values; null is refused during layout because a missing response category cannot be treated as zero. |
| items[].n | number | Responses the row was computed over. Required for percent input to be auditable. |
Options
| Path | Type | Values | Default | Meaning |
|---|---|---|---|---|
| sort | object | string | true | 'sheet', 'asc', 'desc', 'reverse', true (or another value of its type) | Order statements by net score without changing the ordered response scale. | |
| sort.categories | string | 'sheet', 'asc', 'desc', 'reverse' | Statement order: sheet keeps authored order, reverse reverses it, asc and desc rank by net score with stable ties. Overrides sortBy direction. | |
| columnOverrides | object | Settings per generated column. Ids: label, net, base. | ||
| columnOverrides.*.width | number | Track width in px. It beats the width the type would pick. | ||
| columnOverrides.*.align | string | 'left', 'right', 'center' | Alignment of the column: its cell text and, unless headAlign is set, its head. Bars keep starting at the panel origin. | |
| columnOverrides.*.headAlign | string | 'left', 'right', 'center' | Head alignment; defaults to align. | |
| columnOverrides.*.label | string | Head text. | ||
| columnOrder | array | Order of whole blocks; blocks left out follow in default order. Ids: plot, net, base. | ||
| values | string | 'counts', 'percent' | REQUIRED. A 5-point row of counts 20/20/20/20/20 also sums to 100, so counts-vs-percent cannot be sniffed from the data. | |
| neutral | string | 'split', 'positive', 'negative', 'exclude' | 'split' | Where the midpoint's share goes. Default 'split' (half each side, the published convention for diverging Likert charts); 'exclude' drops it and warns that the bars no longer sum to the base. |
| summary | string | 'net', 'none' | 'net' | Net column (% agree − % disagree). Default 'net'; refused with neutral 'positive'/'negative', where the signed stack sum is not the net score. |
| base | string | 'column', 'none' | The base n of each statement as a right-aligned gray column right of the net, under the head 'n'. Default 'column' when the counts or an item's n give a base; percent input without n has none. One base shared by every statement prints once in the head ('n = 900'). The column stays off below 576 px canvas width. | |
| sortBy | string | 'sheet', 'net' | 'sheet' | Default 'sheet' keeps statement order; 'net' ranks by net score, descending unless sort.categories supplies the direction or mode. Ties keep authored order. |
| methodNote | boolean | Default false. true adds the method footnotes: the forced-choice center line, the definition of the net column and the sort order. The neutral treatment and the base of the shares are required for interpretation and print regardless, unless requiredNotes turns them off. | ||
| requiredNotes | object | The two notes a reader needs to read the shares print by default. Turn one off only when the exhibit's own text already says it. | ||
| requiredNotes.neutral | boolean | Default true. false drops the note on the neutral treatment; set it when the title or subtitle already states it ('Neutral split across the center line'). | ||
| requiredNotes.base | boolean | Default true. false drops the note on the base of the shares; set it when the source or a footnote already states it ('n = 882 per statement'). |
Plus the shared options. This type does not accept detailFields, valueAxis, hatchStrength, rounding. This type ignores animate, debug, categoryAxis, categoryLabels, secondaryAxis, topN, valueAxis.show, valueAxis.gridlines 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. | |
| 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. | |
| 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 × 28 px; fit content.
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 |
|---|---|---|
| employee-engagement-5pt | example | Three of seven statements are net-negative; the center line is the midpoint of the neutral segment |
| manager-review-4pt | example | Forced-choice four-point scale: the center line IS the boundary, and no neutral is declared |
| customer-effort-7pt | example | Seven-point effort scale with the neutral excluded — the bars no longer sum to the base, and say so |
| torture-likert-degenerate | torture | Degenerate rows: a base of 7, a single-option row, a 99.6 percent row, a 40% neutral, and bases 7 to 1,204 |
| employee-engagement-compact | torture | Employee engagement in compact framing with sample bases and neutral-share disclosures |
| service-survey-neutral-positive | example | Service survey with neutral responses on the positive side |
| service-survey-neutral-negative | example | Service survey with neutral responses on the negative side |
| dated-survey-comparison | example | Agree share grows 20% annually, while Disagree falls 10 percentage points |
| torture-long-labels | torture | Torture: long names at a generous size read whole, never cut |
| engagement-options | example | The engagement survey with left row labels, thicker bars, one highlighted statement and explicit label kinds |
| engagement-notes-pinned | torture | The engagement survey with its net and base pinned as one-line method notes under the author note |
| engagement-dashboard-notes | torture | The engagement survey on a dashboard with its notes in the info panel |
| twelve-statements-slide | torture | Twelve statements on a full slide print their shares inside the bars |
| column-overrides | example | columnOverrides sets the widths, alignment and head words of the name, net and base columns |
| columns-after-plot | example | columnOrder moves the net and base columns to the other side of the marks |
| inside-base-values | example | Response shares inside each segment base |
Not for
Unordered response categories; likert centers an ordered scale on its neutral point.