Set currency=True for a dollar prefix, unit for a unit suffix, or decimals to an integer for fixed precision. This function returns an expression, not a D3 format string; pass it to labelExpr, not format.
Supported style values: "day", "month", "month_year", "quarter", "year", "fiscal_year". The WBG fiscal year runs July–June (July 2023 is FY24; January 2023 is FY23).
"quarter" and "fiscal_year" cannot be represented as D3 time-format strings. For those, pre-compute values with format_date and pass them to Altair as strings, or use a Vega expression in the axis encoding.
Captions
Attach a styled caption below a chart.
attaviz.add_caption( chart,"Source: World Bank Development Indicators, 2023",*, align="left",)
align — "left" (default, on-spec), "center", or "right".
Embed a newline (\n) in the text for multi-line captions.
add_caption() remains available for compatibility. Prefer frame() for new publication charts because it also requires an accessibility description and supports notes, sources, and a byline.