Class DataLabels
- All Implemented Interfaces:
Serializable
DataLabels class.
- Version:
- $Id: $Id
- Author:
- Vaadin
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for DataLabels.DataLabels(Boolean enabled) Constructor for DataLabels. -
Method Summary
Modifier and TypeMethodDescriptiongetAlign()Getter for the fieldalign.Getter for the fieldallowOverlap.Getter for the fieldbackgroundColor.Getter for the fieldborderColor.Getter for the fieldborderRadius.Getter for the fieldborderWidth.getColor()Getter for the fieldcolor.getCrop()Getter for the fieldcrop.Getter for the fieldenabled.Getter for the fieldformat.getFormatter.Getter for the fieldoverflow.Getter for the fieldpadding.Getter for the fieldrotation.Getter for the fieldshadow.getShape()Getter for the fieldshape.getStyle()Getter for the fieldstyle.Getter for the fielduseHTML.Getter for the fieldverticalAlign.getX()Getter for the fieldx.getY()Getter for the fieldy.Getter for the fieldzIndex.voidsetAlign(HorizontalAlign align) The alignment of the data label compared to the point.voidsetAllowOverlap(Boolean allowOverlap) Whether to allow data labels to overlap.voidsetBackgroundColor(Color backgroundColor) The background color or gradient for the data label.voidsetBorderColor(Color borderColor) The border color for the data label.voidsetBorderRadius(Number borderRadius) The border radius in pixels for the data label.voidsetBorderWidth(Number borderWidth) The border width in pixels for the data label.voidThe text color for the data labels.voidWhether to hide data labels that are outside the plot area.voidsetEnabled(Boolean enabled) Enable or disable the data labels.voidA format string for the data label.voidsetFormatter(String _fn_formatter) Callback JavaScript function to format the data label.voidsetOverflow(String overflow) How to handle data labels that flow outside the plot area.voidsetPadding(Number padding) When either theborderWidthor thebackgroundColoris set, this is the padding within the box.voidsetRotation(Number rotation) Text rotation in degrees.voidThe shadow of the box.voidThe name of a symbol to use for the border around the label.voidStyles for the label.voidsetUseHTML(Boolean useHTML) Whether to use HTML to render the labels.voidsetVerticalAlign(VerticalAlign verticalAlign) The vertical alignment of a data label.voidThe x position offset of the label relative to the point.voidThe y position offset of the label relative to the point.voidThe Z index of the data labels.
-
Constructor Details
-
DataLabels
public DataLabels()Constructor for DataLabels.
-
DataLabels
Constructor for DataLabels.
- Parameters:
enabled- aBooleanobject.
-
-
Method Details
-
getAlign
Getter for the field
align.- Returns:
- a
HorizontalAlignobject. - See Also:
-
setAlign
The alignment of the data label compared to the point. Ifright, the right side of the label should be touching the point. For points with an extent, like map areas, the alignments also dictates how to align it inside the box, as given with the inside option. Can be one of "left", "center" or "right".Defaults to: center
- Parameters:
align- aHorizontalAlignobject.
-
getAllowOverlap
Getter for the field
allowOverlap.- Returns:
- a
Booleanobject. - See Also:
-
setAllowOverlap
Whether to allow data labels to overlap. To make the labels less sensitive for overlapping, the dataLabels.padding can be set to 0.Defaults to: false
- Parameters:
allowOverlap- aBooleanobject.
-
getBackgroundColor
Getter for the field
backgroundColor.- Specified by:
getBackgroundColorin classAbstractDataLabels- Returns:
- a
Colorobject. - See Also:
-
setBackgroundColor
The background color or gradient for the data label. The background color or gradient for the data label. Defaults toundefined.- Specified by:
setBackgroundColorin classAbstractDataLabels- Parameters:
backgroundColor- aColorobject.
-
getBorderColor
Getter for the field
borderColor.- Specified by:
getBorderColorin classAbstractDataLabels- Returns:
- a
Colorobject. - See Also:
-
setBorderColor
The border color for the data label. The border color for the data label. Defaults toundefined.- Specified by:
setBorderColorin classAbstractDataLabels- Parameters:
borderColor- aColorobject.
-
getBorderRadius
Getter for the field
borderRadius.- Specified by:
getBorderRadiusin classAbstractDataLabels- Returns:
- a
Numberobject. - See Also:
-
setBorderRadius
The border radius in pixels for the data label. The border radius in pixels for the data label.Defaults to: 0
- Specified by:
setBorderRadiusin classAbstractDataLabels- Parameters:
borderRadius- aNumberobject.
-
getBorderWidth
Getter for the field
borderWidth.- Specified by:
getBorderWidthin classAbstractDataLabels- Returns:
- a
Numberobject. - See Also:
-
setBorderWidth
The border width in pixels for the data label. The border width in pixels for the data label.Defaults to: 0
- Specified by:
setBorderWidthin classAbstractDataLabels- Parameters:
borderWidth- aNumberobject.
-
getColor
Getter for the field
color.- Specified by:
getColorin classAbstractDataLabels- Returns:
- a
Colorobject. - See Also:
-
setColor
The text color for the data labels. The text color for the data labels. Defaults tonull. Note that data labels in Highmaps by default have astyle.HcTextStrokein order to make the text readable against any background. When the color is changed, it is also recommended to change this.- Specified by:
setColorin classAbstractDataLabels- Parameters:
color- aColorobject.
-
getCrop
Getter for the field
crop.- Specified by:
getCropin classAbstractDataLabels- Returns:
- a
Booleanobject. - See Also:
-
setCrop
Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot area according to the overflow option. Whether to hide data labels that are outside the plot area. By default, the data label is moved inside the plot area according to the overflow option.Defaults to: true
- Specified by:
setCropin classAbstractDataLabels- Parameters:
crop- aBooleanobject.
-
getEnabled
Getter for the field
enabled.- Returns:
- a
Booleanobject. - See Also:
-
setEnabled
Enable or disable the data labels. Enable or disable the data labels.Defaults to: false
- Specified by:
setEnabledin classAbstractDataLabels- Parameters:
enabled- aBooleanobject.
-
getFormat
Getter for the field
format.- Specified by:
getFormatin classAbstractDataLabels- Returns:
- a
Stringobject. - See Also:
-
setFormat
A format string for the data label. Available variables are the same as forformatter. A format string for the data label. Available variables are the same as forformatter.Defaults to: {point.value}
- Specified by:
setFormatin classAbstractDataLabels- Parameters:
format- aStringobject.
-
getFormatter
getFormatter.
- Specified by:
getFormatterin classAbstractDataLabels- Returns:
- a
Stringobject. - See Also:
-
setFormatter
Callback JavaScript function to format the data label. Note that if aformatis defined, the format takes precedence and the formatter is ignored.- Specified by:
setFormatterin classAbstractDataLabels- Parameters:
_fn_formatter- aStringobject.
-
getOverflow
Getter for the field
overflow.- Specified by:
getOverflowin classAbstractDataLabels- Returns:
- a
Stringobject. - See Also:
-
setOverflow
How to handle data labels that flow outside the plot area. The default isjustify, which aligns them inside the plot area. For columns and bars, this means it will be moved inside the bar. To display data labels outside the plot area, setcroptofalseandoverflowto"none". How to handle data labels that flow outside the plot area. The default isjustify, which aligns them inside the plot area. For columns and bars, this means it will be moved inside the bar. To display data labels outside the plot area, setcroptofalseandoverflowto"none".Defaults to: justify
- Specified by:
setOverflowin classAbstractDataLabels- Parameters:
overflow- aStringobject.
-
getPadding
Getter for the field
padding.- Specified by:
getPaddingin classAbstractDataLabels- Returns:
- a
Numberobject. - See Also:
-
setPadding
When either theborderWidthor thebackgroundColoris set, this is the padding within the box. When either theborderWidthor thebackgroundColoris set, this is the padding within the box.Defaults to: 0
- Specified by:
setPaddingin classAbstractDataLabels- Parameters:
padding- aNumberobject.
-
getRotation
Getter for the field
rotation.- Specified by:
getRotationin classAbstractDataLabels- Returns:
- a
Numberobject. - See Also:
-
setRotation
Text rotation in degrees. Note that due to a more complex structure, backgrounds, borders and padding will be lost on a rotated data label. Text rotation in degrees. Note that due to a more complex structure, backgrounds, borders and padding will be lost on a rotated data label.Defaults to: 0
- Specified by:
setRotationin classAbstractDataLabels- Parameters:
rotation- aNumberobject.
-
getShadow
Getter for the field
shadow.- Specified by:
getShadowin classAbstractDataLabels- Returns:
- a
Booleanobject. - See Also:
-
setShadow
The shadow of the box. The shadow of the box. Works best withborderWidthorbackgroundColor. The shadow can also be an object configuration containingcolor,offsetX,offsetY,opacityandwidth.Defaults to: false
- Specified by:
setShadowin classAbstractDataLabels- Parameters:
shadow- aBooleanobject.
-
getShape
Getter for the field
shape.- Specified by:
getShapein classAbstractDataLabels- Returns:
- a
Shapeobject. - See Also:
-
setShape
The name of a symbol to use for the border around the label. Symbols are predefined functions on the Renderer object. The name of a symbol to use for the border around the label. Symbols are predefined functions on the Renderer object.Defaults to: square
- Specified by:
setShapein classAbstractDataLabels- Parameters:
shape- aShapeobject.
-
getStyle
Getter for the field
style.- Specified by:
getStylein classAbstractDataLabels- Returns:
- a
Styleobject. - See Also:
-
setStyle
Styles for the label. Styles for the label. Note that changes in the text color should be accompanied with changes inHcTextStrokein order for the text to stand out against the background.Defaults to: {"color": "contrast", "fontSize": "11px", "fontWeight": "bold"; "textShadow": "0 0 6px contrast, 0 0 3px contrast" }
- Specified by:
setStylein classAbstractDataLabels- Parameters:
style- aStyleobject.
-
getUseHTML
Getter for the field
useHTML.- Specified by:
getUseHTMLin classAbstractDataLabels- Returns:
- a
Booleanobject. - See Also:
-
setUseHTML
Whether to use HTML to render the labels. Whether to use HTML to render the labels.Defaults to: false
- Specified by:
setUseHTMLin classAbstractDataLabels- Parameters:
useHTML- aBooleanobject.
-
getVerticalAlign
Getter for the field
verticalAlign.- Specified by:
getVerticalAlignin classAbstractDataLabels- Returns:
- a
VerticalAlignobject. - See Also:
-
setVerticalAlign
The vertical alignment of a data label. The vertical alignment of a data label. Can be one oftop,middleorbottom.- Specified by:
setVerticalAlignin classAbstractDataLabels- Parameters:
verticalAlign- aVerticalAlignobject.
-
getX
Getter for the field
x.- Returns:
- a
Numberobject. - See Also:
-
setX
The x position offset of the label relative to the point.Defaults to: 0
- Parameters:
x- aNumberobject.
-
getY
Getter for the field
y.- Returns:
- a
Numberobject. - See Also:
-
setY
The y position offset of the label relative to the point.Defaults to: -6
- Parameters:
y- aNumberobject.
-
getZIndex
Getter for the field
zIndex.- Returns:
- a
Numberobject. - See Also:
-
setZIndex
The Z index of the data labels. The default Z index puts it above the series. Use a Z index of 2 to display it behind the series.Defaults to: 6
- Parameters:
zIndex- aNumberobject.
-