Skip to content

IAnnotation

Type interface

An annotation, as stored in the Annotator's annotations setting.

Colors are CSS color strings. Sizes are in pixels.

Sources

IAnnotation is an interface: it describes a shape of data and is not imported on its own.

Properties

ariaLabel

Type undefined | stringSince 5.25.0

What screen readers say for the annotation. If not set: its tool's name, its text, and what it is pinned to (a slice, a node, a data item).

An annotation with no text that isn't pinned to such an item (a frame on an XY chart, a shape pinned to the screen) is read only if this is set.

Set it to "" to keep an annotation from screen readers.

blur

Type undefined | numberSince 5.25.0

A rectangle blurs what is under it: from 0 (no blur) to 1 (most).

Its fill, if any, tints the blur. Used by the "cover" tool.

closed

Type undefined | false | trueSince 5.25.0

A "polyline" goes back from its last point to its first.

endCap

Type AnnotationCap

What the line has at its end.

fill

Type undefined | string

Fill color. None if not set.

fillOpacity

Type undefined | number

Opacity of the fill (0-1).

fontFamily

Type undefined | string

Font family.

fontSize

Type undefined | number

Font size.

icon

Type undefined | stringSince 5.25.0

SVG path of an "icon" annotation, drawn in a 50 by 50 box.

image

Type undefined | string

Image of a hand-drawn line made with an earlier version, as a data URL.

notes

Type undefined | string

Notes, kept from annotations made with an earlier version.

opacity

Type undefined | number

Opacity of the whole annotation (0-1).

pin

Type IAnnotationPin

What the annotation is pinned to. Without one, it stays where it is on the chart's area.

points

Type Array

Points that define the annotation:

  • "rectangle", "ellipse", "caption": two opposite corners.

  • "icon": two opposite corners of the box the icon fits in.

  • "line": start and end.

  • "curve": start, end and control point.

  • "polyline": every point, in order. Each is pinned to what it is on.

  • "freehand": every point of the line; or, for one drawn with an earlier version, two corners of image.

  • "text": center.

  • "callout": the point it points at, and the center of its box.

rotation

Type undefined | number

Rotation in degrees, around the center.

shape

Type AnnotationShape

Shape of the annotation.

startCap

Type AnnotationCap

What the line has at its start.

stroke

Type undefined | string

Line color.

strokeDasharray

Type Array

Line dash pattern, e.g. [3, 3].

strokeWidth

Type undefined | number

Line width.

text

Type undefined | string

Text of a text, callout or caption.

textColor

Type undefined | string

Text color.

tool

Type AnnotationTool

The tool the annotation was made with, if not one named after its shape.

width

Type undefined | number

Width of a text or callout box. Text wraps to it. Fits the text if not set.