Text

Free-positioned text annotations and in-chart callouts.

Use text marks for annotations positioned at raw x and y coordinates. Text does not follow bar or area stacking. For ordinary data labels, use the label property built into bars, lines, areas, dots, and pies instead.

Annotate a point

Layer text over another mark when the annotation is part of the story rather than a standard data label. The text property names the field to display:

dy: -14 shifts the annotation 14 pixels above its raw data coordinate.

Custom text field

Display any string or number 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