Class: Annotation

Highcharts. Annotation

new Annotation()

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:
Type Description
Highcharts.Chart

the chart object

AnnotationOptions

the options object

Members

chart :Highcharts.Chart

The chart that the annotation belongs to.

Type:

labels :Array.<Highcharts.SVGElement>

The array of labels which belong to the annotation.

Type:

options :AnnotationOptions

The options for the annotations. It contains user defined options merged with the default options.

Type:
  • AnnotationOptions

options :AnnotationOptions

The user options for the annotations.

Type:
  • AnnotationOptions

shapes :Array.<Highcharts.SVGElement>

The array of shapes which belong to the annotation.

Type:

Methods

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.

init()

Initialize the annotation.

Parameters:
Type Description
Highcharts.Chart

the chart

AnnotationOptions

the user options for the annotation

redraw()

Main method for drawing an annotation.

render()

Render the annotation.

setVisible( [visibility])

Set the annotation's visibility.

Parameters:
Name Type Argument Description
visibility Boolean <optional>

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