bar and donut layer types for the most common single-series cases, the chart() builder for any family with full control over datasets, marks, encodings, axes, and affordances, and chartFromDocument() as an escape hatch for pre-built chart documents.
All charts are placed on a slide using at coordinates in the 1920×1080 slide space. A good default size for a half-width chart is { x: 160, y: 260, w: 760, h: 580 } and for a full-width chart { x: 160, y: 260, w: 1600, h: 650 }.
Bar charts
Thebar shorthand renders a single-series vertical or horizontal bar chart. It accepts a flat array of ChartDatum objects and a handful of display options — the SDK builds the full chart document internally.
ChartDatum
Each bar is one datum object:Category label displayed on the axis.
The bar’s numeric value.
Optional per-bar color override as a CSS color string. When omitted, the chart uses the deck’s palette cycling.
Optional stable row id. Useful when you later apply chart operations (update-cell, set-series-color) that reference rows by id.
Inline syntax
Builder function syntax
Bar chart options
Array of data points. Must contain at least one item.
Chart title rendered above the plot area.
Bar orientation.
'vertical' (default) draws bars top-to-bottom with categories on the x-axis. 'horizontal' draws bars left-to-right with categories on the y-axis.A d3-format string controlling how values appear on axis ticks and data labels. Examples:
'$,.0f' → $1,234; '.1%' → 12.3%; ',.2f' → 1,234.56.When
true, renders a value label on each bar.When
true, adds a CAGR arrow spanning from the first bar to the last, showing the compound annual growth rate. Common in financial slides.Horizontal bar example
Donut charts
Thedonut shorthand renders a donut (ring) chart. Each ChartDatum becomes one arc slice. Use this for part-to-whole compositions like market share, segment breakdowns, or budget allocations.
Inline syntax
Builder function syntax
Donut chart options
Array of slice data. Each item maps to one arc segment. Must contain at least one item.
Chart title rendered above or inside the donut.
d3-format string for slice labels and tooltips. Use
'.0%' to show percentages.When
true, renders a label on each slice showing its value or percentage.Full chart builder
When you need multi-series data, secondary axes, custom mark styling, affordances (CAGR arrows, trendlines, annotations), or any chart family beyond bar and donut, use thechart() builder with a CreateChartDocumentInput. This is the same structure the Ablo editor persists — every feature available in the UI is accessible here.
The full chart uses a grammar-of-graphics model: you define a dataset (columns + rows), one or more marks that reference that dataset, channel encode bindings that map columns to visual properties, and optional guides (axes, scales, legend) and affordances (labels, annotations, trend lines).
chart() builder
Supported chart families
Thefamily field on a chart document determines the chart type. Every family maps to specific mark types and required encoding channels.
bar
Vertical or horizontal bars. Marks:
bar. Channels: {x, y}.stacked-bar
Stacked segments per category. Marks:
bar. Channels: {x, y, color}.line
Connected series over categories. Marks:
line. Channels: {x, y}.combo
Bars + line on shared or secondary axis. Two marks:
bar + line.pie
Full-circle segments. Marks:
arc. Channels: {label, angle}.donut
Ring segments. Marks:
arc. Channels: {label, angle}.waterfall
Running totals with incremental bars. Marks:
bar with waterfall transform.funnel
Narrowing stages for conversion flows. Marks:
bar.scatter
XY point plot. Marks:
point. Channels: {x, y}.bubble
XY points sized by a third metric. Marks:
point. Channels: {x, y, size}.mekko
Variable-width stacked bars. Channels:
{x, y, width}.gantt
Task timelines with start/end dates. Marks:
task.range
Min-max bands. Marks:
area or range.For
pie and donut families, use {label, angle} channel bindings — not {x, y}. The renderer produces an empty SVG when the wrong channels are set. The bar, line, scatter, and combo families all require {x, y} bindings.Line chart example
Multi-series bar chart with data labels
chartFromDocument()
UsechartFromDocument() when you already have a fully-built ChartDocument — for example, from a prior API response, a stored chart template, or parseChartDocument() from the charts toolkit. It validates the document and wraps it for placement.