Appearance
Are you an LLM? You can read better optimized documentation at /embed/docs/axes.md for this page in Markdown format
Axes
Axes map categories and values onto the chart. Config covers ticks, bounds, formats, dual scales, and label fit.
Axes are keyed by physical side (left | right | top | bottom). Each side holds a role:
| Role | Meaning |
|---|---|
domain | Categories (or linear X on scatter / mekko width) |
primaryRange | Main value scale |
secondaryRange | Second value scale (dual-axis) |
unused | Placeholder for the side not used by the current orientation |
js
axes: {
bottom: { id: 'domain', /* … */ },
left: { id: 'primaryRange', /* … */ },
right: { id: 'secondaryRange', enabled: false, boundSeries: [], /* … */ },
top: { id: 'unused', enabled: false, /* … */ },
}Which role sits on which side depends on orientation. When orientation changes, the embed moves each role to its new side. Put settings on the side that holds that role after the flip (for example, value formats go on left when vertical and on bottom when horizontal).
| Orientation | Domain | Primary range | Secondary range |
|---|---|---|---|
vertical (default) | bottom | left | right |
horizontal | left | bottom | top |
Checklist
Typical order:
- Format the value axis – currency,
%, decimals (Number formats, Value axis) - Tick density – leave auto, or set
preferredTickInterval(Value axis) - Bounds – pin min/max only when you mean it (zero rules, zoom) (Value axis)
- Gridlines – usually on the primary range side (Gridlines)
- Category labels – wrap / rotate / dates when crowded (Domain axis)
- Titles – units on the value axis when the format alone is not enough (Titles & chrome)
- Dual axis / breaks – when you need two scales or a collapsed gap (Secondary, Breaks)
Defaults (what you get)
From getDefaultAxesConfig (new charts):
- Domain: band scale,
fitMechanism: 'wrap', titles hidden - Primary range: linear,
preferredTickInterval: null(auto sparse ticks), gridlines off, titles hidden - Secondary:
enabled: false,visible: false,boundSeries: [] %chart types (stackedBar100, mekko, …) seedpostfix: '%'on the relevant labels- Bar Mekko hides the primary range axis line by default (
visible: false); labels stay available when you turn it on - Pie / donut: axes disabled
axes deep-merges on setChartData / update – see Defaults & merging. Prefer exporting a full tree from the editor (getChartData()) when you need a complete starting point, then patch.
Pages
| Page | Use when |
|---|---|
| Value axis | Ticks, bounds, % charts, zero rules, currency |
| Domain axis | Category labels, wrap/rotate, dates |
| Titles & chrome | Axis titles, visibility, tick marks, colors |
| Secondary / dual axis | Second scale + boundSeries (incl. horizontal top) |
| Axis breaks | Collapse a dead range on the value axis |
| By chart type | What each type exposes / fixes / hides |
| Orientation & roles | Remap rules and the “0,1,2,3,4” pitfall |
Also: Gridlines · Number formats · Orientation
Samples
- Currency ticks – format + preferred interval + title
- Dual-axis line – secondary +
boundSeries - Percent axis – pinned 0–100
%ticks - Horizontal bar – orientation remap (format the bottom range)