Skip to content

Annotation

Type classSince 4.5.5

A plugin which automatically groups PercenSeries slices that are smaller than certain percent into one "Other" slice.

By pushing an instance of Annnotation into plugin list of any Chart, it automatically applies the functionality.

Example:

let annotation = chart.plugins.push(new am4plugins_annotation.Annotation());
let annotation = chart.plugins.push(new am4plugins_annotation.Annotation());
{
  "plugins": [{
    "type": "Annotation"
  }]
}

Sources

This information about Annotation is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.

Inheritance

Annotation extends Plugin.

Annotation is not extended by any other symbol.

Properties

active

Type booleanDefault false

Seting to true puts the chart in annotation mode.

Setting to false returns chart to regular mode of operation.

autoSize

Type booleanDefault falseSince 4.7.19

If set to true plugin will try to reposition annotation relatively when size of the chart chanages.

This feature is experimental. Use at your own risk.

colors

Type Array <Color>

List of colors to show in selection.

currentColor

Type ColorDefault #000

Currently selected color.

currentFontSize

Type numberDefault 10

Currently selected font size.

currentFontWeight

Type numberDefault 400

Currently selected font weight.

currentOpacity

Type numberDefault 1

Currently selected opacity.

currentTool

Type stringDefault select

Currently selected tool.

currentWidth

Type numberDefault 1

Currently selected width.

data

Type anySince 4.5.6

Set or get annotation data.

fabric

Type Canvas

Returns an instance of Fabric's Canvas.

fontSizes

Type Array <number>

List of available font sizes.

fontWeights

Type Array <number>

List of available font weights.

group

Type SVGGElement

A <g> that holds SVG representation of the annotations in chart overlay.

icons

Type Array <string>Default []

List of icons to use in annotation

indicator

Type HTMLElement

Current tool/color indicator element.

opacities

Type Array <number>

List of opacities available for selection.

useMenu

Type booleanDefault trueSince 4.8.0

If set to false the plugin will not create own menu nor will add its items to existing Export menu.

In such case, annotation functionality will be available only via API.

widths

Type Array <number>

List of widths in pixels for line and free-draw tool.

1 inherited item
target

Type Optional <Sprite>Inherited from Plugin

A target object plugin is for.

Methods

activate()

Returns void

Activates annotation mode.

addIcon(url: string)

Returns void

Adds an image to canvas.

addText()

Returns void

Adds an editable text object to canvas.

arrow()

Returns void

Puts annotator in arrow drawing mode.

clear()

Returns void

Clears all annotations.

constructor()

Returns Annotation

Constructor

deactivate()

Returns void

Deactivates annotation mode.

delete()

Returns void

Puts annotator in object deletion mode

deleteSelected()

Returns void

Deletes selected objects

discard()

Returns void

Clears all annotations and exits annotation mode.

draw()

Returns void

Puts annotator in free-drawing mode.

init()

Returns void

line()

Returns void

Puts annotator in line drawing mode.

select()

Returns void

Puts annotator in object selection mode.

setColor(value: Color)

Returns void

Sets color.

setFontSize(value: number)

Returns void

Sets font size.

setFontWeight(value: number)

Returns void

Sets font weight.

setIconFill(img: Image)

Returns void

Attemps to set a fill to the SVG icon.

setOpacity(value: number)

Returns void

Sets opacity.

setWidth(value: number)

Returns void

Sets line width.

underConstruction()

Returns void

Does nothing.

2 inherited items
dispose()

Returns voidInherited from Plugin

Disposes this object and related stuff.

isDisposed()

Returns booleanInherited from Plugin

Returns if this element is already disposed.

Events

Annotation does not have any events.