BarPlot

PropertyDefaultMeaning
coordInferred[xmin, ymin, xmax, ymax] shorthand for both limits
xlim / ylimInferredDirected data limits
flip-x / flip-yfalse / trueReverse horizontal or vertical screen mapping
padding0.05Inferred-limit fractions: scalar, side/axis object, [h, v], or [t, b, l, r]
values[]Bar endpoints
positionsIndicesBar centers
bases0Scalar, array, or callback for bar baselines
bar-width0.8Scalar, array, or callback for widths in data units
direction"vertical"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
axistrueEnable or disable both axes by default
xaxis / yaxisaxisBoolean or Axis props for one axis
xticks / yticks5Target count or explicit values / labeled pairs
gridtrueDraw grid lines at axis ticks
title / xlabel / ylabel—String or Element; the y title rotates −90°
legend—Legend Element or array of Legend entries
marginem(3/4)Extra outer space; accepts Box padding forms
label-gapem(1/2)Space between titles and measured axis extents
bounds"outer""frame" makes the allocation the data area alone; see below
background—Full-frame background paint
plot-background—Data-area background paint
border-widthpx(0)Data-area border thickness
border-color"theme:border"Data-area border paint
cliptrueClip data marks to the data area
axis-* / xaxis-* / yaxis-*—Flat Axis option overrides
tick-* / label-*—Shared generated tick and label styles
title-* / xlabel-* / ylabel-*—Generated title text options
grid-* / xgrid-* / ygrid-*—Grid options and styles
legend-*—Generated Legend options
*-style—Nested options for the corresponding scopes

Compose Bars and Plot. Accepts values, positions, bases, bar-width, direction, border radius, and styles along with Plot props. Additional children overlay bars and participate in limit inference.

For rounded tops with square baselines on positive vertical bars, use border-radius={{ t: em(0.5) }}. Horizontal bars can use border-radius={{ r: em(0.5) }}. Sides refer to screen edges, so negative bars may need b or l instead. Scalar, paired, and individual corner radii follow Bars.

Padding follows Graph: values are fractions of inferred data spans. Use padding={[0.12, 0.1]} for horizontal/vertical padding, or Box-style side shorthands for individual edges. margin adds layout space around the plot.

fill and border-radius set shared bar defaults; entries returned by styles can override either. For a value-dependent radius, return it from styles:

This rounds the exposed ends under the default vertical axes. border_radius: 0 keeps an individual bar square; an omitted radius uses the shared default. Callbacks receive the endpoint value and original index, and run once at construction. Use styles for per-bar callbacks; border-radius itself takes a shared radius value.

Positions are numeric data coordinates. Supply [value,label] ticks for categories: xticks for vertical bars, yticks for horizontal. Limits include baselines and widths. Grouping and automatic stacking are deferred.