Skip to content

Level lines

A level line is a reference line at a fixed value on a range axis. Config lives at annotations.levelLines.<id>.

Unlike arrows, simple level lines are reasonable to hand-author. For label snap / custom number formats, authoring in the editor then exporting is still easiest.

Minimal example

js
annotations: {
  levelLines: {
    target: {
      id: 'target',
      value: 70,
      color: '#1A1A1A',
      width: 1.5,
      dashArray: '6,4',
      rangeAxis: 'primaryRange',
      labelFontFamily: 'Arial',
      labelFontSize: 10,
      labelFontColor: '#000000',
    },
  },
}

Solid stroke: prefer dashArray: '' (same convention as gridlines).

Fields

FieldTypeNotes
idstringShould match the map key
valuenumberPosition on the range axis
colorstringLine color
widthnumberStroke width (px)
dashArraystringDash pattern; '' = solid
rangeAxis'primaryRange' | 'secondaryRange'Which scale measures value (default primary)
labelPositionIndexnumber | nullHorizontal snap for the value label; omit/null for auto edge placement
labelFontFamily / labelFontSize / labelFontColorstring / number / stringPer-line label chrome
labelNumberFormatSpecobject{ mode: 'custom'|'linked', source?, customFormat } — see Number formats

Shared bag option: annotations.levelLines.fontFamily can set a default label font for all lines.

Chart types

Common on stacked / clustered / 100% bar, waterfall, line, stacked area, scatter, combo, and bar mekko. Orientation-aware: the line follows the range axis (horizontal line on a vertical chart, and the remapped equivalent when orientation flips).

Live patches

annotations deep-merges for nested story maps in many host paths, but the safest pattern for one-off adds is still: read getChartData(), merge the new id into levelLines, then setChartData with the updated map (or replace the whole annotations.levelLines object you want).

See also Arrows.

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