szum

Text

Data labels, value annotations, and positioned text.

Use text marks to label data points or annotate specific values. Text is almost always layered on top of another mark.

Value labels

Place the value above each bar. The text field names which datum field to display:

dy: -12 shifts labels 12 pixels above the data point. Without it, labels sit directly on the bar top.

Custom text field

Display any field from your data – not just x or y:

Alignment

textAnchor controls horizontal alignment relative to the data point:

ValueBehavior
"start"Left-aligned at the point
"center"Centered on the point (default)
"end"Right-aligned at the point

Properties

FieldTypeDefaultDescription
textstring"text"Field name to display as the label.
dxnumber0Horizontal offset in pixels.
dynumber0Vertical offset in pixels. Negative moves up.
fontSizenumberOverride the theme font size.
fontWeightstringOverride the font weight.
textAnchor"start" | "center" | "end""center"Horizontal alignment.

On this page