Annotations
An annotation
is a text box that can be placed inside a
graph.
A common usage for an annotation is a graph legend, which is detailed in a separate documentation article.
Interface
Properties
-
text
:KontrastString
(default value: empty string)The actual text the annotation displays. The string can contain HTML tags, which are correctly translated into HTML elements (the string is assigned via the
innerHTML
property). -
zone
:KontrastSelection
(default value:'top'
, possible values:'inside'
,'left'
,'right'
,'top'
,'bottom'
,'top-left'
,'top-right'
,'bottom-left'
,'bottom-right'
)The zone in which the annotation is placed.
-
excludeFromLayout
:KontrastBoolean
(default value:false
)Whether the annotation is excluded from the layout algorithm. If set to
true
, the annotation might be still visible but the margins of the zone where the annotations is placed in are not influenced by the annotation. -
textColor
:KontrastColor
(default value:'black'
)The color of the text.
-
opacity
:KontrastNumber
(default value:1
)The opacity of the element (both text and background).
-
backgroundColor
:KontrastColor
(default value:'white'
)The background color of the element.
-
backgroundOpacity
:KontrastNumber
(default value:0
)The opacity of the background only.
-
horizontalOrigin
:KontrastNumber
(default value:0
)The horizontal origin of the annotation. A value of -1 corresponds to the left of the zone; a value of 1 corresponds to the right of the zone.
-
verticalOrigin
:KontrastNumber
(default value:0
)The vertical origin of the annotation. The origin refers to the relative coordinate system of the zone of the annotation. A value of -1 corresponds to the bottom of the zone; a value of 1 corresponds to the top of the zone.
-
horizontalAnchor
:KontrastNumber
(default value:0
)The horizontal point within the element that is used as a positioning anchor. A value of -1 corresponds to the bottom of the annotation; a value of 1 corresponds to the top of the annotation. The anchor specifies a point within the annotation. This anchor point is positioned within the specified graph zone according to the origin of the annotation.
-
verticalAnchor
:KontrastNumber
(default value:0
)The vertical point within the element used to anchor it. A value of -1 corresponds to the left of the annotation; a value of 1 corresponds to the right of the annotation. The anchor specifies a point within the annotation. This anchor point is positioned within the specified graph zone according to the origin of the annotation.