Class Labels
- java.lang.Object
- 
- org.pepstock.charba.client.commons.NativeObjectContainer
- 
- org.pepstock.charba.client.commons.AbstractNode
- 
- org.pepstock.charba.client.treemap.Labels
 
 
 
- 
 public final class Labels extends AbstractNode The labels can control if and how a label, to represent the data, can be shown in the rectangle.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Field SummaryFields Modifier and Type Field Description static AlignDEFAULT_ALIGNDefault label alignment,Align.LEFTstatic StringDEFAULT_COLORDefault label color,HtmlColor.TRANSPARENTstatic booleanDEFAULT_DISPLAYDefault labels display, false.static OverflowDEFAULT_OVERFLOWDefault labels overflow,Overflow.CUT.static intDEFAULT_PADDINGDefault label padding, 3static PositionDEFAULT_POSITIONDefault labels position,Position.MIDDLE.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AligngetAlign()Returns the text horizontal alignment used when drawing the label.AlignCallbackgetAlignCallback()Returns the align callback, if set, otherwisenull.List<IsColor>getColor()Returns the color of the text.List<String>getColorAsString()Returns the color of the text.ColorsCallbackgetColorCallback()Returns the color callback, if set, otherwisenull.IsFontgetFont()Returns the font object.FontsCallbackgetFontCallback()Returns the font callback, if set, otherwisenull.List<IsFont>getFonts()Returns the font of the text.FormatterCallbackgetFormatterCallback()Returns the formatter callback, if set, otherwisenull.List<IsColor>getHoverColor()Returns the color of the text, when hovered.List<String>getHoverColorAsString()Returns the color of the text, when hovered.ColorsCallbackgetHoverColorCallback()Returns the hover color callback, if set, otherwisenull.IsFontgetHoverFont()Returns the font object when hovered.FontsCallbackgetHoverFontCallback()Returns the hover font callback, if set, otherwisenull.List<IsFont>getHoverFonts()Returns the font of the text, when hovered.OverflowgetOverflow()Returns the control what happens to a label that is too big to fit into a rectangle.OverflowCallbackgetOverflowCallback()Returns the overflow callback, if set, otherwisenull.intgetPadding()Returns the padding to apply around labels.PositiongetPosition()Returns the text vertical alignment used when drawing the label.PositionCallbackgetPositionCallback()Returns the position callback, if set, otherwisenull.booleanisDisplay()Returnstruewhether the element should be displayed.voidsetAlign(NativeCallback alignCallback)Sets the align callback.voidsetAlign(AlignCallback alignCallback)Sets the align callback.voidsetAlign(Align align)Sets the text horizontal alignment used when drawing the label.voidsetColor(String... colors)Sets the color of the text.voidsetColor(List<IsColor> colors)Sets the color of the text.voidsetColor(NativeCallback colorCallback)Sets the color callback.voidsetColor(IsColor... colors)Sets the color of the text.voidsetColor(ColorsCallback colorCallback)Sets the color callback.voidsetDisplay(boolean display)Setstruewhether the element should be displayed.voidsetFont(NativeCallback fontCallback)Sets the font callback.voidsetFont(FontsCallback fontCallback)Sets the font callback.voidsetFonts(List<FontItem> fonts)Sets the font of the text.voidsetFonts(FontItem... fonts)Sets the font of the text.voidsetFormatter(NativeCallback formatterCallback)Sets the formatter callback.voidsetFormatter(FormatterCallback formatterCallback)Sets the formatter callback.voidsetHoverColor(String... hoverColors)Sets the color of the text, when hovered.voidsetHoverColor(List<IsColor> hoverColors)Sets the color of the text, when hovered.voidsetHoverColor(NativeCallback hoverColorCallback)Sets the hover color callback.voidsetHoverColor(IsColor... hoverColors)Sets the color of the text, when hovered.voidsetHoverColor(ColorsCallback hoverColorCallback)Sets the hover color callback.voidsetHoverFont(NativeCallback hoverFontCallback)Sets the hover font callback.voidsetHoverFont(FontsCallback hoverFontCallback)Sets the hover font callback.voidsetHoverFonts(List<FontItem> fonts)Sets the font of the text, when hovered.voidsetHoverFonts(FontItem... fonts)Sets the font of the text, when hovered.voidsetOverflow(NativeCallback overflowCallback)Sets the overflow callback.voidsetOverflow(OverflowCallback overflowCallback)Sets the overflow callback.voidsetOverflow(Overflow overflow)Sets the control what happens to a label that is too big to fit into a rectangle.voidsetPadding(int padding)Sets the padding to apply around labels.voidsetPosition(NativeCallback positionCallback)Sets the position callback.voidsetPosition(PositionCallback positionCallback)Sets the position callback.voidsetPosition(Position position)Sets the text vertical alignment used when drawing the label.- 
Methods inherited from class org.pepstock.charba.client.commons.AbstractNodecheckAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
 - 
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainercheckAndGetColor, checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_DISPLAYpublic static final boolean DEFAULT_DISPLAY Default labels display, false.- See Also:
- Constant Field Values
 
 - 
DEFAULT_POSITIONpublic static final Position DEFAULT_POSITION Default labels position,Position.MIDDLE.
 - 
DEFAULT_OVERFLOWpublic static final Overflow DEFAULT_OVERFLOW Default labels overflow,Overflow.CUT.
 - 
DEFAULT_ALIGNpublic static final Align DEFAULT_ALIGN Default label alignment,Align.LEFT
 - 
DEFAULT_COLORpublic static final String DEFAULT_COLOR Default label color,HtmlColor.TRANSPARENT
 - 
DEFAULT_PADDINGpublic static final int DEFAULT_PADDING Default label padding, 3- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getFontpublic IsFont getFont() Returns the font object.- Returns:
- the font object.
 
 - 
getHoverFontpublic IsFont getHoverFont() Returns the font object when hovered.- Returns:
- the font object when hovered
 
 - 
setFontspublic void setFonts(FontItem... fonts) Sets the font of the text.- Parameters:
- fonts- the font of the text
 
 - 
setFontspublic void setFonts(List<FontItem> fonts) Sets the font of the text.- Parameters:
- fonts- the font of the text
 
 - 
setHoverFontspublic void setHoverFonts(FontItem... fonts) Sets the font of the text, when hovered.- Parameters:
- fonts- the font of the text, when hovered
 
 - 
setHoverFontspublic void setHoverFonts(List<FontItem> fonts) Sets the font of the text, when hovered.- Parameters:
- fonts- the font of the text, when hovered
 
 - 
getHoverFontspublic List<IsFont> getHoverFonts() Returns the font of the text, when hovered.- Returns:
- the font of the text, when hovered
 
 - 
setColorpublic void setColor(IsColor... colors) Sets the color of the text.- Parameters:
- colors- the color of the text
 
 - 
setColorpublic void setColor(List<IsColor> colors) Sets the color of the text.- Parameters:
- colors- the color of the text
 
 - 
setColorpublic void setColor(String... colors) Sets the color of the text.- Parameters:
- colors- the color of the text
 
 - 
getColorAsStringpublic List<String> getColorAsString() Returns the color of the text.- Returns:
- the color of the text
 
 - 
getColorpublic List<IsColor> getColor() Returns the color of the text.- Returns:
- the color of the text
 
 - 
setHoverColorpublic void setHoverColor(IsColor... hoverColors) Sets the color of the text, when hovered.- Parameters:
- hoverColors- the color of the text, when hovered
 
 - 
setHoverColorpublic void setHoverColor(List<IsColor> hoverColors) Sets the color of the text, when hovered.- Parameters:
- hoverColors- the color of the text, when hovered
 
 - 
setHoverColorpublic void setHoverColor(String... hoverColors) Sets the color of the text, when hovered.- Parameters:
- hoverColors- the color of the text, when hovered
 
 - 
getHoverColorAsStringpublic List<String> getHoverColorAsString() Returns the color of the text, when hovered.- Returns:
- the color of the text, when hovered
 
 - 
getHoverColorpublic List<IsColor> getHoverColor() Returns the color of the text, when hovered.- Returns:
- the color of the text, when hovered
 
 - 
setPositionpublic void setPosition(Position position) Sets the text vertical alignment used when drawing the label.- Parameters:
- position- the text vertical alignment used when drawing the label
 
 - 
getPositionpublic Position getPosition() Returns the text vertical alignment used when drawing the label.- Returns:
- the text vertical alignment used when drawing the label
 
 - 
setOverflowpublic void setOverflow(Overflow overflow) Sets the control what happens to a label that is too big to fit into a rectangle.- Parameters:
- overflow- the control what happens to a label that is too big to fit into a rectangle
 
 - 
getOverflowpublic Overflow getOverflow() Returns the control what happens to a label that is too big to fit into a rectangle.- Returns:
- the control what happens to a label that is too big to fit into a rectangle
 
 - 
getPositionCallbackpublic PositionCallback getPositionCallback() Returns the position callback, if set, otherwisenull.- Returns:
- the position callback, if set, otherwise null.
 
 - 
setPositionpublic void setPosition(PositionCallback positionCallback) Sets the position callback.- Parameters:
- positionCallback- the position callback.
 
 - 
setPositionpublic void setPosition(NativeCallback positionCallback) Sets the position callback.- Parameters:
- positionCallback- the position callback.
 
 - 
getOverflowCallbackpublic OverflowCallback getOverflowCallback() Returns the overflow callback, if set, otherwisenull.- Returns:
- the overflow callback, if set, otherwise null.
 
 - 
setOverflowpublic void setOverflow(OverflowCallback overflowCallback) Sets the overflow callback.- Parameters:
- overflowCallback- the overflow callback.
 
 - 
setOverflowpublic void setOverflow(NativeCallback overflowCallback) Sets the overflow callback.- Parameters:
- overflowCallback- the overflow callback.
 
 - 
getColorCallbackpublic ColorsCallback getColorCallback() Returns the color callback, if set, otherwisenull.- Returns:
- the color callback, if set, otherwise null.
 
 - 
setColorpublic void setColor(ColorsCallback colorCallback) Sets the color callback.- Parameters:
- colorCallback- the color callback.
 
 - 
setColorpublic void setColor(NativeCallback colorCallback) Sets the color callback.- Parameters:
- colorCallback- the color callback.
 
 - 
getHoverColorCallbackpublic ColorsCallback getHoverColorCallback() Returns the hover color callback, if set, otherwisenull.- Returns:
- the hover color callback, if set, otherwise null.
 
 - 
setHoverColorpublic void setHoverColor(ColorsCallback hoverColorCallback) Sets the hover color callback.- Parameters:
- hoverColorCallback- the hover color callback.
 
 - 
setHoverColorpublic void setHoverColor(NativeCallback hoverColorCallback) Sets the hover color callback.- Parameters:
- hoverColorCallback- the color callback.
 
 - 
getFontCallbackpublic final FontsCallback getFontCallback() Returns the font callback, if set, otherwisenull.- Returns:
- the font callback, if set, otherwise null.
 
 - 
setFontpublic final void setFont(FontsCallback fontCallback) Sets the font callback.- Parameters:
- fontCallback- the font callback to set
 
 - 
setFontpublic final void setFont(NativeCallback fontCallback) Sets the font callback.- Parameters:
- fontCallback- the font callback to set
 
 - 
getHoverFontCallbackpublic final FontsCallback getHoverFontCallback() Returns the hover font callback, if set, otherwisenull.- Returns:
- the hover font callback, if set, otherwise null.
 
 - 
setHoverFontpublic final void setHoverFont(FontsCallback hoverFontCallback) Sets the hover font callback.- Parameters:
- hoverFontCallback- the hover font callback to set
 
 - 
setHoverFontpublic final void setHoverFont(NativeCallback hoverFontCallback) Sets the hover font callback.- Parameters:
- hoverFontCallback- the hover font callback to set
 
 - 
setAlignpublic final void setAlign(Align align) Sets the text horizontal alignment used when drawing the label.- Parameters:
- align- the text horizontal alignment used when drawing the label.
 
 - 
getAlignpublic final Align getAlign() Returns the text horizontal alignment used when drawing the label.- Returns:
- the text horizontal alignment used when drawing the label.
 
 - 
setPaddingpublic final void setPadding(int padding) Sets the padding to apply around labels.- Parameters:
- padding- padding to apply around labels.
 
 - 
getPaddingpublic final int getPadding() Returns the padding to apply around labels.- Returns:
- padding to apply around labels.
 
 - 
getFormatterCallbackpublic final FormatterCallback getFormatterCallback() Returns the formatter callback, if set, otherwisenull.- Returns:
- the formatter callback, if set, otherwise null.
 
 - 
setFormatterpublic final void setFormatter(FormatterCallback formatterCallback) Sets the formatter callback.- Parameters:
- formatterCallback- the formatter callback.
 
 - 
setFormatterpublic final void setFormatter(NativeCallback formatterCallback) Sets the formatter callback.- Parameters:
- formatterCallback- the formatter callback.
 
 - 
getAlignCallbackpublic final AlignCallback getAlignCallback() Returns the align callback, if set, otherwisenull.- Returns:
- the align callback, if set, otherwise null.
 
 - 
setAlignpublic final void setAlign(AlignCallback alignCallback) Sets the align callback.- Parameters:
- alignCallback- the align callback.
 
 - 
setAlignpublic final void setAlign(NativeCallback alignCallback) Sets the align callback.- Parameters:
- alignCallback- the align callback.
 
 - 
setDisplaypublic final void setDisplay(boolean display) Setstruewhether the element should be displayed.- Parameters:
- display-- truewhether the element should be displayed
 
 - 
isDisplaypublic final boolean isDisplay() Returnstruewhether the element should be displayed.- Returns:
- truewhether the element should be displayed
 
 
- 
 
-