Class LabelBuilder
- java.lang.Object
- 
- org.pepstock.charba.client.labels.LabelBuilder
 
- 
 public final class LabelBuilder extends Object Comfortable object to createLabelsPlugin.IDplugin LABEL options by a builder.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelsOptionsBuildergetOptionsBuilder()Returns theLabelsPlugin.IDlabel builder.LabelBuildersetArc(boolean arc)Sets if draws label in arc.LabelBuildersetColor(String color)Sets the font color as string.LabelBuildersetColor(IsColor color)Sets the font color as color.LabelBuildersetFont(FontCallback<LabelsContext> fontColorCallback)Sets the font color callback.LabelBuildersetFontFamily(String fontFamily)Sets the font familyLabelBuildersetFontSize(int size)Sets the font size.LabelBuildersetFontStyle(FontStyle fontStyle)Sets the font style.LabelBuildersetImages(Img... images)Sets the images whenRenderisRender.IMAGE.LabelBuildersetOutsidePadding(int outsidePadding)Sets the padding when position isPosition.OUTSIDE.LabelBuildersetOverlap(boolean overlap)Sets if draws label even it's overlap.LabelBuildersetPosition(Position position)+ Sets the position to draw label.LabelBuildersetPrecision(int precision)Sets the precision for percentage.LabelBuildersetRender(RenderCallback renderCallback)Sets the render callback.LabelBuildersetRender(Render render)Sets what data must be showed.LabelBuildersetShadowBlur(int shadowBlur)Sets the text shadow intensity.LabelBuildersetShadowColor(String shadowColor)Sets the text shadow color as string.LabelBuildersetShadowColor(IsColor shadowColor)Sets the text shadow color as color.LabelBuildersetShadowOffsetX(int shadowOffsetX)Sets the text shadow X offset.LabelBuildersetShadowOffsetY(int shadowOffsetY)Sets the text shadow Y offset.LabelBuildersetShowActualPercentages(boolean showActualPercentages)Sets if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages to 100 in total.LabelBuildersetShowZero(boolean showZero)Sets whether or not labels of value 0 are displayed.LabelBuildersetTextMargin(int textMargin)Sets the margin of text when position isPosition.OUTSIDEorPosition.BORDER.LabelBuildersetTextShadow(boolean textShadow)Sets if draws text shadows under labels.
 
- 
- 
- 
Method Detail- 
getOptionsBuilderpublic LabelsOptionsBuilder getOptionsBuilder() Returns theLabelsPlugin.IDlabel builder.- Returns:
- the LabelsPlugin.IDlabel builder
 
 - 
setRenderpublic LabelBuilder setRender(Render render) Sets what data must be showed.- Parameters:
- render- what data must be showed.
- Returns:
- builder instance
 
 - 
setPrecisionpublic LabelBuilder setPrecision(int precision) Sets the precision for percentage.- Parameters:
- precision- the precision for percentage
- Returns:
- builder instance
 
 - 
setShowZeropublic LabelBuilder setShowZero(boolean showZero) Sets whether or not labels of value 0 are displayed.- Parameters:
- showZero- whether or not labels of value 0 are displayed.
- Returns:
- builder instance
 
 - 
setFontSizepublic LabelBuilder setFontSize(int size) Sets the font size.- Parameters:
- size- the font size.
- Returns:
- builder instance
 
 - 
setColorpublic LabelBuilder setColor(IsColor color) Sets the font color as color.- Parameters:
- color- the font color as color.
- Returns:
- builder instance
 
 - 
setColorpublic LabelBuilder setColor(String color) Sets the font color as string.- Parameters:
- color- the font color as string.
- Returns:
- builder instance
 
 - 
setFontStylepublic LabelBuilder setFontStyle(FontStyle fontStyle) Sets the font style.- Parameters:
- fontStyle- the font style.
- Returns:
- builder instance
 
 - 
setFontFamilypublic LabelBuilder setFontFamily(String fontFamily) Sets the font family- Parameters:
- fontFamily- the font family
- Returns:
- builder instance
 
 - 
setTextShadowpublic LabelBuilder setTextShadow(boolean textShadow) Sets if draws text shadows under labels.- Parameters:
- textShadow-- trueif draws text shadows under labels.
- Returns:
- builder instance
 
 - 
setShadowBlurpublic LabelBuilder setShadowBlur(int shadowBlur) Sets the text shadow intensity.- Parameters:
- shadowBlur- the text shadow intensity.
- Returns:
- builder instance
 
 - 
setShadowOffsetXpublic LabelBuilder setShadowOffsetX(int shadowOffsetX) Sets the text shadow X offset.- Parameters:
- shadowOffsetX- the text shadow X offset.
- Returns:
- builder instance
 
 - 
setShadowOffsetYpublic LabelBuilder setShadowOffsetY(int shadowOffsetY) Sets the text shadow Y offset.- Parameters:
- shadowOffsetY- the text shadow Y offset.
- Returns:
- builder instance
 
 - 
setShadowColorpublic LabelBuilder setShadowColor(IsColor shadowColor) Sets the text shadow color as color.- Parameters:
- shadowColor- the text shadow color as color.
- Returns:
- builder instance
 
 - 
setShadowColorpublic LabelBuilder setShadowColor(String shadowColor) Sets the text shadow color as string.- Parameters:
- shadowColor- the text shadow color as string.
- Returns:
- builder instance
 
 - 
setArcpublic LabelBuilder setArc(boolean arc) Sets if draws label in arc. For bar chart this is ignored.- Parameters:
- arc- if draws label in arc.
- Returns:
- builder instance
 
 - 
setPositionpublic LabelBuilder setPosition(Position position) + Sets the position to draw label. For bar chart this is ignored.- Parameters:
- position- the position to draw label.
- Returns:
- builder instance
 
 - 
setOverlappublic LabelBuilder setOverlap(boolean overlap) Sets if draws label even it's overlap. For bar chart this is ignored.- Parameters:
- overlap- if draws label even it's overlap.
- Returns:
- builder instance
 
 - 
setShowActualPercentagespublic LabelBuilder setShowActualPercentages(boolean showActualPercentages) Sets if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages to 100 in total.- Parameters:
- showActualPercentages- if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages to 100 in total.
- Returns:
- builder instance
 
 - 
setOutsidePaddingpublic LabelBuilder setOutsidePadding(int outsidePadding) Sets the padding when position isPosition.OUTSIDE.- Parameters:
- outsidePadding- the padding when position is- Position.OUTSIDE.
- Returns:
- builder instance
 
 - 
setTextMarginpublic LabelBuilder setTextMargin(int textMargin) Sets the margin of text when position isPosition.OUTSIDEorPosition.BORDER.- Parameters:
- textMargin- the margin of text when position is- Position.OUTSIDEor- Position.BORDER.
- Returns:
- builder instance
 
 - 
setImagespublic LabelBuilder setImages(Img... images) Sets the images whenRenderisRender.IMAGE.- Parameters:
- images- images when- Renderis- Render.IMAGE.
- Returns:
- builder instance
 
 - 
setRenderpublic LabelBuilder setRender(RenderCallback renderCallback) Sets the render callback.- Parameters:
- renderCallback- the render callback to set
- Returns:
- builder instance
 
 - 
setFontpublic LabelBuilder setFont(FontCallback<LabelsContext> fontColorCallback) Sets the font color callback.- Parameters:
- fontColorCallback- the font color callback.
- Returns:
- builder instance
 
 
- 
 
-