IChartAnnotation

interface
Chart

A single overlay annotation drawn on top of a cartesian chart SVG surface. Supports four kinds: arrow, label, circle and bracket. Positioned in data coordinates and projected to pixel space by the chart X/Y scales.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

kind
required
'arrow' | 'label' | 'circle' | 'bracket'
Annotation kind. arrow = directed line with arrowhead; label = callout box; circle = stroked circle; bracket = horizontal or L-shaped span.
x
required
number | string
Source / anchor X coordinate in data space (category string or numeric index).
y
required
number
Source / anchor Y coordinate in data space.
x2
number | string
End-point X in data space. Required for arrow (head position) and bracket (right edge).
y2
number
End-point Y in data space. Optional for bracket — when omitted the bracket stays horizontal.
text
string
Text content rendered alongside the annotation.
color
TIntent | string
Stroke / fill colour — accepts a TIntent name or any CSS colour string.
width
number
Stroke width in SVG units. Default 1.5.
radius
number
Circle radius in SVG units. Applies to the circle kind only. Default 12.
dx
number
Horizontal offset of the text label relative to its anchor point in SVG units. Default 0.
dy
number
Vertical offset of the text label relative to its anchor point in SVG units. Default -14.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Annotating a chart data point with an arrow

typescript