Skip to content

Annotation action

Use this action with change({ id: 'Annotation', context }).

Context

  • id: Get | Delete | Update | Duplicate
  • index: optional annotation index (Get)
  • uid: annotation uid
  • traits: replacement trait values (Update)
  • extras: additional non-editable metadata merged into traits (Update)
  • points: point updates (Update)

Behavior

Annotation is a multi-action API for removing, updating, or duplicating annotations.

Notes for Get

  • Get returns annotation models from all panes/axes.
  • Returned items include paneIndex, axisIndex, and list index for stable host-side addressing.

Notes for Update

  • traits are replaced with the values you send.
  • extras are merged and are not interpreted by chart logic.
  • Editable trait availability depends on annotation type; use annotation taxonomy as source of truth.
  • Common editable fields include line, fill, showPrices, and showBarCount (when supported by the annotation type).

Style details:

  • line.color / fill.color accept CSS3-like color strings (#rgb, #rrggbb, rgba(r,g,b,a)).
  • line also supports lineWidth and dashStyle.
  • Supported dash styles: Solid, ShortDash, ShortDot, ShortDashDot, ShortDashDotDot, SparseDot, Dot, Dash, LongDash, DashDot, LongDashDot.

Point updates:

  • Most annotations manage points interactively, so sending points usually has no effect.
  • ComputedText is an important exception. Updating points beyond the first two can be useful; the first two are reserved for text bounds (top-left and bottom-right).

For integration flow details, see Notifications and Annotations.