Likert chart reference

Likert examples

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

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

PathTypeRequiredMeaning
scalearrayyesResponse 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[].idstringyesResponse-option identity used by keyed statement values.
scale[].labelstringDisplayed response-option name; defaults to its id.
scale[].rolestringThe 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'.
itemsarrayyesSurvey statements and their response distributions, displayed in input order unless sorting is requested.
items[].idstringyesUnique survey-statement identity.
items[].labelstringDisplayed survey statement; defaults to its id.
items[].datestringISO observation date for dated survey-wave comparisons; statement order does not supply a period.
items[].valuesarrayyesCounts or percentages per DECLARED scale option, positional or keyed. Which of the two is declared by options.values and is never inferred.
items[].values[].optionIdstringyesDeclared scale-option id receiving this response value.
items[].values[].valuenumber | nullyesCount or percentage according to options.values; null is refused during layout because a missing response category cannot be treated as zero.
items[].nnumberResponses the row was computed over. Required for percent input to be auditable.

Options

PathTypeValuesDefaultMeaning
sortobject | 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.categoriesstring'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.
columnOverridesobjectSettings per generated column. Ids: label, net, base.
columnOverrides.*.widthnumberTrack width in px. It beats the width the type would pick.
columnOverrides.*.alignstring'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.*.headAlignstring'left', 'right', 'center'Head alignment; defaults to align.
columnOverrides.*.labelstringHead text.
columnOrderarrayOrder of whole blocks; blocks left out follow in default order. Ids: plot, net, base.
valuesstring'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.
neutralstring'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.
summarystring'net', 'none''net'Net column (% agree − % disagree). Default 'net'; refused with neutral 'positive'/'negative', where the signed stack sum is not the net score.
basestring'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.
sortBystring'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.
methodNotebooleanDefault 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.
requiredNotesobjectThe 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.neutralbooleanDefault 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.basebooleanDefault 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.

KindPurposeRequiredAnchorsOptional fieldsNotes
cagrDraws 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.
diffDraws a level-difference arrow between two anchors and computes either percent change or their signed value difference.from, tofrom: AnchorRef; to: AnchorRefmode: 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.
deltaComputes the signed difference between an anchored value and another anchor or literal, then places a collision-managed label at the first anchor.at, vsat: AnchorRef; vs: AnchorRef | numbermode: 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.
notePlaces authored text at an anchored data element through collision avoidance, with an optional icon or status chip.at, textat: AnchorRef
calloutPlaces authored free text at an anchored data element, routing a leader when displaced and honoring the preferred side.at, textat: AnchorRefpreferSide: 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.
textPlaces 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, textat: 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.
lineDraws 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, tofrom: 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.
arrowDraws 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, tofrom: 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.
boxDraws 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, tofrom: 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

IDKindUse case
employee-engagement-5ptexampleThree of seven statements are net-negative; the center line is the midpoint of the neutral segment
manager-review-4ptexampleForced-choice four-point scale: the center line IS the boundary, and no neutral is declared
customer-effort-7ptexampleSeven-point effort scale with the neutral excluded — the bars no longer sum to the base, and say so
torture-likert-degeneratetortureDegenerate 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-compacttortureEmployee engagement in compact framing with sample bases and neutral-share disclosures
service-survey-neutral-positiveexampleService survey with neutral responses on the positive side
service-survey-neutral-negativeexampleService survey with neutral responses on the negative side
dated-survey-comparisonexampleAgree share grows 20% annually, while Disagree falls 10 percentage points
torture-long-labelstortureTorture: long names at a generous size read whole, never cut
engagement-optionsexampleThe engagement survey with left row labels, thicker bars, one highlighted statement and explicit label kinds
engagement-notes-pinnedtortureThe engagement survey with its net and base pinned as one-line method notes under the author note
engagement-dashboard-notestortureThe engagement survey on a dashboard with its notes in the info panel
twelve-statements-slidetortureTwelve statements on a full slide print their shares inside the bars
column-overridesexamplecolumnOverrides sets the widths, alignment and head words of the name, net and base columns
columns-after-plotexamplecolumnOrder moves the net and base columns to the other side of the marks
inside-base-valuesexampleResponse shares inside each segment base

Not for

Unordered response categories; likert centers an ordered scale on its neutral point.