Skip to content

IAnnotatorSettings

Type interface

Sources

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

Inheritance

IAnnotatorSettings extends IEntitySettings.

IAnnotatorSettings is not extended by any other symbol.

Properties

Defaults are those of Annotator. Classes that extend it can have other defaults: see their settings.

annotations

Type ArraySince 5.25.0

The annotations. Setting it draws them, e.g. to restore annotations saved earlier. It is updated when annotation mode closes.

buttons

Type ArrayDefault [ "pin", "undo", "redo", "delete", "clear", "layout", "done" ]Since 5.25.0

Buttons in the toolbar besides the tools, in their usual places:

  • "pin" - pins new annotations to the chart or to the screen.

  • "undo", "redo".

  • "delete" - removes the selected annotation.

  • "clear" - removes all annotations, once confirmed.

  • "layout" - lays the toolbar out in rows or in a column.

  • "done" - closes annotation mode, keeping the changes.

  • "cancel" - closes annotation mode, dropping the changes.

captionText

Type undefined | stringDefault root.language.translateAny("Text")Since 5.25.0

Text of a new caption.

colors

Type ArrayDefault computed at runtimeSince 5.25.0

Colors offered in the toolbar.

defaultText

Type undefined | stringDefault root.language.translateAny("Your text here")Since 5.25.0

Text of a new text or callout.

disableRotation

Type undefined | false | trueDefault falseSince 5.25.0

Hides the grip that rotates an annotation.

escapeAction

Type "save" | "cancel" | "none"Default "save"Since 5.25.0

What ESC does in annotation mode, once nothing is selected:

  • "save" - closes it, keeping the changes.

  • "cancel" - closes it, dropping the changes.

  • "none" - nothing.

fill

Type ColorDefault root.interfaceColors.get("background")Since 5.25.0

Fill color of new ellipses that are filled and of callouts. The chart's background color by default.

fontFamilies

Type ArrayDefault [ "Helvetica, Arial, sans-serif", "Times, \"Times New Roman\", serif", "Courier, \"Courier New\", monospace", "cursive", "fantasy" ]Since 5.25.0

Font families offered in the toolbar.

fontFamily

Type undefined | stringSince 5.25.0

Font family of new annotations. The chart's if not set.

fontSize

Type undefined | numberDefault 16Since 5.25.0

Font size of new annotations.

fontSizes

Type ArrayDefault [ 12, 16, 20, 28, 40 ]Since 5.25.0

Font sizes offered in the toolbar.

highlightColor

Type ColorDefault am5.color(0xFFFF00)Since 5.25.0

Color of new highlights.

highlightOpacity

Type undefined | numberDefault 0.5Since 5.25.0

Opacity of new highlights.

icons

Type ArraySince 5.25.0

Icons the icon tool offers. The stock chart's arrows and icons if not set.

layer

Type undefined | numberDefault 1000

Layer the annotations are drawn on, above the chart.

markerSettings

Type undefined | objectSince 5.7.4

Deprecated Use the Annotator's own settings

Settings of marker.js 2, which earlier versions used. Those that have an equivalent are applied, e.g. defaultColorSet as colors and defaultStrokeWidth as strokeWidth.

markerState

Type any

Deprecated Use annotations

Annotations in the format of marker.js 2, which earlier versions used.

Setting it draws them. When annotation mode closes, the annotations are also written here in that format, so setups that save it keep working.

Use annotations instead: only it keeps what annotations are pinned to.

markerStyleSettings

Type undefined | objectSince 5.7.5

Deprecated Use a theme

Toolbar styles of marker.js 2, which earlier versions used. Colors of the toolbar and toolbox are applied.

opacitySteps

Type ArrayDefault [ 0.1, 0.25, 0.5, 0.75, 1 ]Since 5.25.0

Opacities offered in the toolbar.

pinTo

Type "chart" | "screen"Default "chart"Since 5.25.0

What new annotations are pinned to:

  • "chart" - what is under them: values of an XY chart's axes, a place on a map, a pie slice, or a hierarchy or flow node. They then move, resize and zoom with it. Where there is nothing to pin to, they stay where they are on the chart's area.

  • "screen" - where they are on the chart's area.

The user can switch it in the toolbar.

stroke

Type ColorDefault am5.color(0xEF4444)Since 5.25.0

Line color of new annotations.

strokeDasharray

Type ArraySince 5.25.0

Dash pattern of new annotations.

strokeDasharrays

Type ArrayDefault [ [], [ 3, 3 ], [ 12, 3 ], [ 9, 6, 3, 6 ] ]Since 5.25.0

Dash patterns offered in the toolbar. An empty one is a solid line.

strokeWidth

Type undefined | numberDefault 3Since 5.25.0

Line width of new annotations.

strokeWidths

Type ArrayDefault [ 1, 2, 3, 5, 10 ]Since 5.25.0

Line widths offered in the toolbar.

textColor

Type ColorDefault am5.color(0xEF4444)Since 5.25.0

Text color of new annotations.

toolbarLayout

Type "horizontal" | "vertical" | "auto"Default "auto"Since 5.25.0

How the toolbar is laid out when annotation mode opens: in rows along the chart's top, or in a column by its left edge. "auto" picks a column if the chart is taller than it is wide, and rows otherwise.

The user can switch it, move the toolbar by its grip, and collapse it by clicking the grip.

tools

Type ArrayDefault [ "rectangle", "ellipse", "highlight", "cover", "line", "arrow", "curve", "measure", "polyline", "freehand", "text", "callout", "caption", "icon" ]Since 5.25.0

Tools in the toolbar, in this order.

9 inherited items
animations

Type ArrayInherited from IEntitySettingsSince 5.20.8

Animations the element plays on its own, described as data - so they can be set from a JSON config and saved with it.

Each one animates a setting of the element (or, with target: "dataItem", a value of its data item - a map point's positionOnLine, say). They start when the setting is applied, restart when it changes, and stop when the element is disposed. A saved config keeps what was configured, never a value caught half way through an animation.

sprite.set("animations", [
  { key: "rotation", to: 360, duration: 4000, loops: 0 },
  { key: "scale", from: 1, to: 1.3, duration: 800, loops: 0, yoyo: true, easing: "sine" }
]);
id

Type undefined | stringInherited from IEntitySettings

A unique ID for looking the element up in root.entitiesById. Setting an ID that another element already has throws an error.

ignoreThemes

Type undefined | false | trueDefault falseInherited from IEntitySettingsSince 5.15.6

Ignores themes: no theme rule applies to the element, not even one of the default theme.

stateAnimationDuration

Type undefined | numberDefault 0Inherited from IEntitySettings

How long, in milliseconds, a switch from one state to another animates.

0 switches at once.

stateAnimationEasing

Type $ease.EasingDefault am5.ease.out(am5.ease.cubic)Inherited from IEntitySettings

Easing of the animated switch from one state to another.

themes

Type ArrayInherited from IEntitySettings

Themes applied to the element and everything inside it.

themeTags

Type ArrayDefault []Inherited from IEntitySettings

Tags that theme rules can target. They also count for the element's children, so a rule can match a child by a tag of its parent.

More info: Themes

themeTagsSelf

Type ArrayInherited from IEntitySettings

Tags that theme rules can target, like themeTags, but only for this element, not its children.

More info: Themes

userData

Type anyInherited from IEntitySettings

Any data of your own to keep with the element.