Skip to content

Text boxes

Free callouts on the chart. In the editor they are Add text box; in chartData they live at top-level multilines (an array).

Title, subtitle & footnote are the same multiline text shape, but as fixed docked furniture — not members of multilines.

js
multilines: [
  {
    id: 'multiline-callout-1',
    text: 'Note: figures are unaudited.',
    visible: true,
    leftXPercentage: 0.62,
    topYPercentage: 0.12,
    positionRelativeTo: 'drawableChartArea',
    width: 160,
    fontSize: 11,
    backgroundColor: 'transparent',
    movable: true,
    deletable: true,
  },
]

Defaults seed multilines: []. There is no textBoxes or annotations.textBoxes key on chartData.


Free boxes vs docked furniture

Text boxes (multilines[])Title / subtitle / footnote
StorageArray of N boxesThree fixed keys: title, subtitle, footnote
PlacementFree — you set % coordsDocked — engine places them each draw
Plot spaceOverlay only (does not reserve margin)Reserves top / bottom margin
Movable / deletableUsually truefalse
positionRelativeToUsually 'drawableChartArea''fullChart'
DocsThis pageTitle, subtitle & footnote

Axis titles under axes.*.axisTitle also use multiline text, but they are axis chrome — see Titles & chrome. Not free text boxes.


Placement

FieldRole
leftXPercentage / topYPercentagePosition as fractions of the reference area (roughly 01)
positionRelativeTo'drawableChartArea' — plot area (default for free boxes). 'fullChart' — full canvas
widthWrap width in px (editor ~130, a typical hand-authored width is 160)
movabletrue so the box can be dragged in edit mode

Free boxes can overlap series and labels because they do not push the plot. Precise placement is easiest by dragging in edit mode, then exporting config.


Fields

FieldTypeNotes
idstringUnique; editor uses multiline-…
textstringPlain text or inline HTML (<font>, <b>, <br>, …) — same rules as title furniture
visiblebooleanOff unless true and text is non-empty
fontSizenumberPoints (default 11)
backgroundColorstringe.g. 'transparent' or a callout fill
leftXPercentage / topYPercentagenumberSee placement
positionRelativeTostring'drawableChartArea' | 'fullChart'
widthnumberWrap width (px)
movable / deletablebooleanDefaults true for free boxes
selectors.resizablebooleanEditor may set true for resize handles

Examples

Plain callout:

js
multilines: [
  {
    id: 'note-1',
    text: 'Excludes one-offs.',
    visible: true,
    leftXPercentage: 0.7,
    topYPercentage: 0.15,
    positionRelativeTo: 'drawableChartArea',
    width: 140,
    fontSize: 10,
    backgroundColor: 'transparent',
    movable: true,
    deletable: true,
  },
]

Styled HTML + fill:

js
multilines: [
  {
    id: 'highlight-1',
    text: '<font face="Arial" color="#111827"><b>Peak quarter</b></font>',
    visible: true,
    leftXPercentage: 0.55,
    topYPercentage: 0.2,
    positionRelativeTo: 'drawableChartArea',
    width: 160,
    fontSize: 11,
    backgroundColor: '#E8E8E8',
    movable: true,
    deletable: true,
  },
]

Replace or append the whole multilines array on setChartData / update when managing multiple boxes (arrays typically replace rather than deep-merge item-by-item).


Tips

  • Product name: text box. Data path: multilines.
  • For chart title / units / source line, use title, subtitle & footnote so layout reserves space correctly.
  • Prefer edit-mode placement + getChartData() / exportConfig() when coordinates matter.

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