Skip to content

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:

RoleMeaning
domainCategories (or linear X on scatter / mekko width)
primaryRangeMain value scale
secondaryRangeSecond value scale (dual-axis)
unusedPlaceholder 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).

OrientationDomainPrimary rangeSecondary range
vertical (default)bottomleftright
horizontalleftbottomtop

Checklist ​

Typical order:

  1. Format the value axis – currency, %, decimals (Number formats, Value axis)
  2. Tick density – leave auto, or set preferredTickInterval (Value axis)
  3. Bounds – pin min/max only when you mean it (zero rules, zoom) (Value axis)
  4. Gridlines – usually on the primary range side (Gridlines)
  5. Category labels – wrap / rotate / dates when crowded (Domain axis)
  6. Titles – units on the value axis when the format alone is not enough (Titles & chrome)
  7. 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, …) seed postfix: '%' 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 ​

PageUse when
Value axisTicks, bounds, % charts, zero rules, currency
Domain axisCategory labels, wrap/rotate, dates
Titles & chromeAxis titles, visibility, tick marks, colors
Secondary / dual axisSecond scale + boundSeries (incl. horizontal top)
Axis breaksCollapse a dead range on the value axis
By chart typeWhat each type exposes / fixes / hides
Orientation & rolesRemap rules and the “0,1,2,3,4” pitfall

Also: Gridlines · Number formats · Orientation


Samples ​

Developer documentation for Chartbuddy Embed · Not the end-user Help Center · Help Center