HBars

PropertyDefaultMeaning
values[]Bar endpoints
positionsIndicesBar centers; must match values
bases0Scalar, array, or callback for bar baselines
bar-width0.8Scalar, array, or callback for widths in data units
direction"horizontal"Vertical or horizontal bars
border-radius0Scalar, elliptical pair, or side/corner object in layout units
styles—Per-bar style array or (value, index) => style callback; may override border-radius
spaceAutomaticUse ambient data coordinates or local geometry

Draw bars from values. positions supplies centers (default indices starting at zero), bases defaults to zero, and bar-width to 0.8 data units. bases and bar-width accept a scalar, a same-length array, or (value,index) function. Values are endpoints, not lengths relative to a base.

direction defaults to vertical, or horizontal for HBars. Negative values work in either direction. Widths and bases contribute to inferred limits. Nonfinite values are omitted without shifting category indices.

styles accepts a same-length array or (value,index) function returning style objects, evaluated once at construction. Defaults: blue fill, no stroke. border-radius rounds corners in layout units such as em(0.25). Use Graph or Plot for data coordinates.

Use border-radius={{ r: em(0.5) }} for rounded right ends and square left ends, or specify individual tl, tr, bl, and br corners. Each entry accepts a length or elliptical pair. See Bars for all forms and screen-edge semantics. For value-dependent rounding, return border_radius from styles, for example styles={(v) => ({ border_radius: v < 0 ? { l: em(0.5) } : { r: em(0.5) } })}.