Bar charts

Compare categories horizontally when labels are long or rank matters.

bar is the horizontal categorical family. It uses the same category and value roles as column, but gives labels more horizontal room and makes top-to-bottom ranking natural.

Ranked comparison

Edit me!

For ranking, sort by value and place the largest category first. An explicit category list is better when the order has domain meaning, such as funnel stages or survey responses.

Grouped and stacked bars

Use a series role or wide values for multiple series. arrangement: { type: "grouped" } compares series directly; { type: "stacked" } emphasizes totals and composition.

Ranged bars

Use values.type: "range" for durations and intervals that have a start and end but no central estimate. A ranged bar is horizontal; use column for the vertical orientation. The category scale is band, while the value scale may be linear, log, or UTC.

{
  "type": "bar",
  "category": { "field": "phase" },
  "values": {
    "type": "range",
    "start": { "field": "startsAt" },
    "end": { "field": "endsAt" },
    "scale": { "type": "utc" }
  }
}

Every end must be after its start. Range values do not stack, group, normalize, aggregate, or introduce a series; spacing, color, corners, strokes, and axes remain ordinary bar presentation.

Labels and corners

Native labels understand bar length, stacking, series identity, and contrast. Simple and grouped labels can use auto, inside, or outside; an outside label is not suppressed merely because it is taller than its bar band, and a zero-value label stays visible to the right of its zero-length bar. Stacked segment labels stay centered inside and disappear when they do not fit; totals: true adds a separate outside total. Set totals: false or omit it to hide totals. cornerRadius changes only the exposed end corners so stacked segments still meet cleanly.

Use labels selectively on dense grouped charts. A shared value axis may communicate comparison more clearly than printing every number.

Draw one series as a line

line.series names series that are drawn as a line on the same value scale instead of as bars. Use it for a benchmark, a total, or a co-measure that deserves different visual weight.

{ "line": { "series": ["Active paying"], "curve": "monotone" } }

The named series leave the stack or group and read against the shared value axis; the rest keep their geometry. curve, stroke.width, points, and labels style the line and reuse the line vocabulary, while color still comes from the existing series channel, so the legend shows a line glyph for a promoted series and a filled swatch for the others.

series must name at least one member of the effective series domain and may not name every series – that intent is a line chart. Promotion needs an effective series and is unavailable on ranged bars and on percent-normalized arrangements, where a raw-value line against a 0–100% axis would be meaningless.

References and annotations

Fixed reference lines work well for targets or service-level thresholds; calculated references can follow the average, median, minimum, or maximum of visible or all data. Category references identify a particular band. Attach an annotation to a category and series when it should follow that datum through updates and filtering; use { type: "coordinate", category, value } for an exact position.

Properties

FieldTypeDefaultDescription
version"2026-09-26"–Required. The chart config version.
typeChartType–Required. The chart family.
titlestring– Chart title.
subtitlestring– Supporting text beneath the title.
captionstring– Caption below the chart for a source, methodology note, or date.
accessibilityDescriptionstring– Accessible description of the chart's meaning.
headerAlign"start" | "center" | "end"theme default Horizontal alignment for the title and subtitle. Omit it to use the selected theme's alignment.
localestring"en-US" Locale identifier accepted by JavaScript Intl and associated with the chart content, such as en, pl, or zh-Hant.
themeThemeName"editorial" One of 6 built-in themes.
themeOverridesThemeOverrides– Override individual theme properties.
categoryBarCategoryRole | RangeCategoryRole–Required. Category field; band or UTC scales for scalar bars, and band scales for ranges.
valuesValuesRole | RangeValuesRole–Required. Long, wide, count, or start/end range values.
arrangementBarArrangementPreferencestacked for series values Stacked or grouped placement for series values; percent normalization belongs to the stacked branch. Omit for simple and ranged bars.
orderCategoryOrder | RangeCategoryOrder– Category/value sorting or explicit order for scalar bars; ranges support category sorting or explicit order.
spacingBarSpacingPreference– Category spacing; series spacing is available only for grouped bars.
colorCategoricalColor– Categorical color preferences.
categoryAxisboolean | AxisOptions– True shows the category axis, false hides it, and an options object shows it with those settings. Omit for defaults.
plotBorderbooleantheme default Full plot border, independent of axis visibility.
valueAxisboolean | AxisOptions– True shows the value axis, false hides it, and an options object shows it with those settings. Omit for defaults.
annotationsCartesianAnnotation[]– Positioned annotations for scalar bars.
referencesCategoricalReference[]– Reference lines for scalar bars.
cornerRadiusnumbertheme default Bar end-corner radius.
strokeStroke– Bar stroke color and width.
labelsStackedBarLabels | PositionableBarLabels– Scalar bar labels: stacked content, or simple/grouped content and position.
totalsboolean– Show or hide totals for unnormalized stacked bars. Omit to hide.
linePromotedLine– Draw named series as a line on the same value scale instead of bars or areas. "series" is a non-empty subset of the effective series domain and may not name every series; use type "line" for that. Unavailable on ranged bars and on percent-normalized arrangements.

On this page