Class: Annotation

Annotation

new Annotation(chart, options)

An annotation class which serves as a container for items like labels or shapes. Created items are positioned on the chart either by linking them to existing points or created mock points

Parameters:
Name Type Description
chart Highcharts.Chart

a chart instance

options AnnotationOptions

the options object

Mixes In:
  • Annotation.controllableMixin
  • Annotation.eventEmitterMixin

Members

<static> shapesMap

An object uses for mapping between a shape type and a constructor. To add a new shape type extend this object with type name as a key and a constructor as its value.

group :Highcharts.SVGElement

The group svg element.

Type:

labelCollector :function

The callback that reports to the overlapping-labels module which labels it should account for.

Type:
  • function

labelsGroup :Highcharts.SVGElement

The group svg element of the annotation's labels.

Type:

shapesGroup :Highcharts.SVGElement

The group svg element of the annotation's shapes.

Type:

Methods

adjustVisibility(item)

Hide or show annotaiton attached to points.

Parameters:
Name Type Description
item Annotation.Label | Annotation.Shape

destroy()

Destroy the annotation. This function does not touch the chart that the annotation belongs to (all annotations are kept in the chart.annotations array) - it is recommended to use Highcharts.Chart#removeAnnotation instead.

destroyItem(item)

Destroy a single item.

Parameters:
Name Type Description
item Annotation.Label | Annotation.Shape

init()

Initialize the annotation.

Parameters:
Type Description
Highcharts.Chart

the chart

AnnotationOptions

the user options for the annotation

initLabel(labelOptions)

Initialisation of a single label

Parameters:
Name Type Description
labelOptions Object

initShape(shapeOptions)

Initialisation of a single shape

Parameters:
Name Type Description
shapeOptions Object

a confg object for a single shape

redrawItem(item [, animation])

Redraw a single item.

Parameters:
Name Type Argument Description
item Annotation.Label | Annotation.Shape
animation boolean <optional>

redrawItems(items [, animation])

Parameters:
Name Type Argument Description
items Array.<(Annotation.Label|Annotation.Shape)>
animation boolean <optional>

remove()

See Highcharts.Annotation#destroy.

setOptions()

Set an annotation options.

Parameters:
Type Description
AnnotationOptions

user options for an annotation

setVisibility( [visible])

Set the annotation's visibility.

Parameters:
Name Type Argument Description
visible Boolean <optional>

Whether to show or hide an annotation. If the param is omitted, the annotation's visibility is toggled.

Type Definitions

Label

Type:
  • Annotation.ControllableLabel

Shape

Type:
  • Annotation.ControllableCircle | Annotation.ControllableImage | Annotation.ControllablePath | Annotation.ControllableRect