Bars answer categorical magnitude questions through length from a shared baseline. Sort them when rank is part of the question, keep a semantic order when sequence matters, and use a lighter comparison mark when a filled bar would overstate the data.
| Reader question | Start with |
|---|---|
| Which category has the largest or smallest value? | Sorted bars |
| Which categories have notable endpoints without emphasizing area? | Lollipops |
| How far apart are two values for each category? | Dumbbells |
| How do signed contributions bridge from a start to a total? | A waterfall |
| How do subgroups contribute to each category? | Grouped or stacked bars in Stacked and Composed Charts |
Use horizontal bars when labels are long or when the rank itself should read top to bottom. Layout, Axes, and Coordinates shows how categorical orientation and automatic guide margins fit together.
Sorting the scale domain makes the intended ranking explicit. Sorting only the input rows is insufficient when several layers or prepared datasets share the same categorical axis.
Bar charts normally include zero on the quantitative domain. Truncating that baseline turns small differences into large apparent changes.
A lollipop keeps the common baseline and precise endpoint while replacing the filled rectangle with a thin link. It is useful for many categories or when the endpoint matters more than area.
Compose the stem and endpoint as separate marks. The Rules, Links, Arrows, Vectors, and Ticks reference defines the link channels; Dot and Hexagon Marks defines the endpoint layer.
Dumbbells emphasize the distance and direction between two endpoints without implying the combined area of grouped bars.
Label the endpoint semantics in a legend or surrounding text. If chronological order between two periods is the message, a slopegraph may be more direct; if absolute magnitudes must remain independently comparable, use grouped bars.
A waterfall requires cumulative preparation. Each contribution becomes an explicit lower and upper interval; the renderer should not guess whether a row is a delta, subtotal, or total.
Keep the cumulative calculation in application data preparation and pass the prepared interval channels to a ranged bar or rectangle. The ownership boundary is described in Scales and D3, and the geometry contracts are in Bar and Rect Marks.