Chart specifications
The declarative ChartSpec model — families, field channels, and styling.
A chart is described by a ChartSpec: a validated, declarative document that says what to render and how to style it. There is no arbitrary renderer code — unsupported options are rejected, and every accepted field is declared in the capability resource.
Anatomy of a spec
Prop
Type
Validation
Before anything renders, the spec is validated against the bound dataset:
- Field types must match the channel's expectations — a date dimension is not silently cast to a string category.
- Measures must be measures; dimensions must be dimensions.
- Point counts are bounded — very large selections are rejected rather than rendered unreadably.
Errors come back with paths and codes, both in the editor and over the API.
Accessibility patterns
Charts are drawn in colour alone by default: no hatching on bars, slices or
areas. To add diagonal hatch patterns that separate series without relying on
colour, set the optional accessibility field:
{ "accessibility": { "patterns": true } }patterns is a boolean and defaults to off. A spec without the field is
unchanged. The setting applies wherever the spec renders: PNG and SVG exports,
public chart pages, embeds and share cards. Readers whose system asks for
higher contrast (prefers-contrast: more) see the patterns on the web
regardless of the spec. Screen-reader labels are always on. Unknown keys inside
accessibility are rejected.
Where specs live
Specs are immutable once accepted: an edit produces a new revision on the artifact. The full declarative surface is available through the API, MCP, and SDK; the console editor exposes the common controls.
Related
- Chart bindings — how specs reference data.
- Exports — rendering specs to images and data.
- Your first chart walkthrough: first chart.