Axis label
A property of type KontrastAxisLabel
allows to specify
the position and appearance (i.e. color, opacity) of axis labels. Note
that you do not need to create this object yourself; it is
automatically created for each axis.
Interface
Properties
-
text
:KontrastString
(default value: empty string)The actual text the label displays. The string can contain HTML tags, which are correctly translated into HTML elements (the string is assigned via the
innerHTML
property). -
hidden
:KontrastBoolean
(default value:false
)Hide the label.
-
textColor
:KontrastColor
(default value:'black'
)The color of the text.
-
backgroundColor
:KontrastColor
(default value:'white'
)The background color of the label.
-
opacity
:KontrastNumber
(default value:1
)The opacity of the full label (both text and background).
-
backgroundOpacity
:KontrastNumber
(default value:0
)The opacity of the background only.
-
position
:KontrastNumber
(default value:1
)The relative position of the label on the axis. A value of zero corresponds to the start of the axis and a value of one to the end of the axis.
-
verticalAnchor
:KontrastNumber
(default value:1
)The vertical point within the label used to anchor it. A value of -1 corresponds to the left of the label, a value of 1 to the right of the label.
-
horizontalAnchor
:KontrastNumber
(default value:1
)The horizontal point within the label that is used as a positioning anchor. A value of -1 corresponds to the bottom of the label, a value of 1 to the top of the label.
-
rotation
:KontrastNumber
(default value:0
)The clockwise rotation angle of the label (in radians). The anchor of the rotation is the same as for the translation (
horizontalAnchor
andverticalAnchor
). -
rotateRelativeToLine
:KontrastBoolean
(default value:false
)This boolean decides whether the rotation angle is measured relative to the axis line (
true
) or not (false
).