Class ValueLabel
- java.lang.Object
- 
- org.pepstock.charba.client.impl.charts.ValueLabel
 
- 
 public final class ValueLabel extends Object Meter element class to define the value label to render in the meter chart.- Author:
- Andrea "Stock" Stocchero
 
- 
- 
Field SummaryFields Modifier and Type Field Description static IsColorDEFAULT_FONT_COLORDefault color of render, rgb(128, 128, 128)static intDEFAULT_PRECISIONDefault precision 2 to apply rendering the value or percentage.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColorgetColor()Returns the font color of the label.StringgetColorAsString()Returns the font color of the label.ColorCallback<MeterContext>getColorCallback()Returns the callback to customize the font color for rendered label in the chart.IsFontgetFont()Returns the font of the label.FontCallback<MeterContext>getFontCallback()Returns the callback to customize the font for rendered label in the chart.MeterFormatCallbackgetFormatCallback()Returns the callback to customize the value string in the chart.intgetPrecision()Returns the decimal places to apply to render the value.booleanisAnimated()Returns if the render will be shown based on the animation of chart.booleanisAutoFontSize()Returnstrueif the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.booleanisDisplay()Returnstruewhether the element label should be displayed.booleanisPercentage()Returnstrueif the value will be rendered as percentage.voidsetAnimated(boolean animated)Sets if the render will be shown based on the animation of chart.voidsetAutoFontSize(boolean autoFontSize)Setstrueif the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.voidsetColor(String color)Sets the font color of the label.voidsetColor(ColorCallback<MeterContext> colorCallback)Sets the callback to customize the font color for rendered label in the chart.voidsetColor(IsColor color)Sets the font color of the label.voidsetDisplay(boolean display)Setstruewhether the element label should be displayed.voidsetFont(FontCallback<MeterContext> fontCallback)Sets the callback to customize the font for rendered label in the chart.voidsetFormatCallback(MeterFormatCallback formatCallback)Sets the callback to customize the value string in the chart.voidsetPercentage(boolean percentage)Setstrueif the value will be rendered as percentage.voidsetPrecision(int precision)Sets the decimal places to apply to render the value.
 
- 
- 
- 
Field Detail- 
DEFAULT_PRECISIONpublic static final int DEFAULT_PRECISION Default precision 2 to apply rendering the value or percentage.- See Also:
- Constant Field Values
 
 - 
DEFAULT_FONT_COLORpublic static final IsColor DEFAULT_FONT_COLOR Default color of render, rgb(128, 128, 128)
 
- 
 - 
Method Detail- 
isPercentagepublic boolean isPercentage() Returnstrueif the value will be rendered as percentage.- Returns:
- trueif the value will be rendered as percentage
 
 - 
setPercentagepublic void setPercentage(boolean percentage) Setstrueif the value will be rendered as percentage.- Parameters:
- percentage-- trueif the value will be rendered as percentage
 
 - 
getPrecisionpublic int getPrecision() Returns the decimal places to apply to render the value.- Returns:
- the decimal places to apply to the value in chart
 
 - 
setPrecisionpublic void setPrecision(int precision) Sets the decimal places to apply to render the value.- Parameters:
- precision- the decimal places to apply to the value in chart
 
 - 
isAnimatedpublic boolean isAnimated() Returns if the render will be shown based on the animation of chart.- Returns:
- the truethe rendering is animated, otherwisefalse
 
 - 
setAnimatedpublic void setAnimated(boolean animated) Sets if the render will be shown based on the animation of chart.- Parameters:
- animated-- trueif the rendering is animated, otherwise- false
 
 - 
getFormatCallbackpublic MeterFormatCallback getFormatCallback() Returns the callback to customize the value string in the chart.- Returns:
- the callback to customize the value string in the chart
 
 - 
setFormatCallbackpublic void setFormatCallback(MeterFormatCallback formatCallback) Sets the callback to customize the value string in the chart.- Parameters:
- formatCallback- the callback to customize the value string in the chart
 
 - 
setDisplaypublic final void setDisplay(boolean display) Setstruewhether the element label should be displayed.- Parameters:
- display-- truewhether the element label should be displayed
 
 - 
isDisplaypublic final boolean isDisplay() Returnstruewhether the element label should be displayed.- Returns:
- truewhether the element label should be displayed
 
 - 
getFontpublic final IsFont getFont() Returns the font of the label.- Returns:
- the font of the label
 
 - 
isAutoFontSizepublic final boolean isAutoFontSize() Returnstrueif the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.- Returns:
- trueif the font size of the rendering will be automatically calculated, based on dimension of the area for rendering
 
 - 
setAutoFontSizepublic final void setAutoFontSize(boolean autoFontSize) Setstrueif the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.- Parameters:
- autoFontSize-- trueif the font size of the rendering will be automatically calculated, based on dimension of the area for rendering
 
 - 
setColorpublic final void setColor(String color) Sets the font color of the label.- Parameters:
- color- the font color of the label
 
 - 
setColorpublic final void setColor(IsColor color) Sets the font color of the label.- Parameters:
- color- the font color of the label
 
 - 
getColorAsStringpublic final String getColorAsString() Returns the font color of the label.- Returns:
- the font color of the label
 
 - 
getColorpublic final IsColor getColor() Returns the font color of the label.- Returns:
- the font color of the label
 
 - 
getColorCallbackpublic final ColorCallback<MeterContext> getColorCallback() Returns the callback to customize the font color for rendered label in the chart.- Returns:
- the callback to customize the font color for rendered label in the chart
 
 - 
setColorpublic final void setColor(ColorCallback<MeterContext> colorCallback) Sets the callback to customize the font color for rendered label in the chart.- Parameters:
- colorCallback- the callback to customize the font color for rendered label in the chart
 
 - 
getFontCallbackpublic final FontCallback<MeterContext> getFontCallback() Returns the callback to customize the font for rendered label in the chart.- Returns:
- the callback to customize the font for rendered label in the chart
 
 - 
setFontpublic final void setFont(FontCallback<MeterContext> fontCallback) Sets the callback to customize the font for rendered label in the chart.- Parameters:
- fontCallback- the callback to customize the font for rendered label in the chart
 
 
- 
 
-