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 Summary
Fields Modifier and Type Field Description static IsColor
DEFAULT_FONT_COLOR
Default color of render, rgb(128, 128, 128)static int
DEFAULT_PRECISION
Default precision 2 to apply rendering the value or percentage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColor
getColor()
Returns the font color of the label.String
getColorAsString()
Returns the font color of the label.ColorCallback<MeterContext>
getColorCallback()
Returns the callback to customize the font color for rendered label in the chart.IsFont
getFont()
Returns the font of the label.FontCallback<MeterContext>
getFontCallback()
Returns the callback to customize the font for rendered label in the chart.MeterFormatCallback
getFormatCallback()
Returns the callback to customize the value string in the chart.int
getPrecision()
Returns the decimal places to apply to render the value.boolean
isAnimated()
Returns if the render will be shown based on the animation of chart.boolean
isAutoFontSize()
Returnstrue
if the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.boolean
isDisplay()
Returnstrue
whether the element label should be displayed.boolean
isPercentage()
Returnstrue
if the value will be rendered as percentage.void
setAnimated(boolean animated)
Sets if the render will be shown based on the animation of chart.void
setAutoFontSize(boolean autoFontSize)
Setstrue
if the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.void
setColor(String color)
Sets the font color of the label.void
setColor(ColorCallback<MeterContext> colorCallback)
Sets the callback to customize the font color for rendered label in the chart.void
setColor(IsColor color)
Sets the font color of the label.void
setDisplay(boolean display)
Setstrue
whether the element label should be displayed.void
setFont(FontCallback<MeterContext> fontCallback)
Sets the callback to customize the font for rendered label in the chart.void
setFormatCallback(MeterFormatCallback formatCallback)
Sets the callback to customize the value string in the chart.void
setPercentage(boolean percentage)
Setstrue
if the value will be rendered as percentage.void
setPrecision(int precision)
Sets the decimal places to apply to render the value.
-
-
-
Field Detail
-
DEFAULT_PRECISION
public static final int DEFAULT_PRECISION
Default precision 2 to apply rendering the value or percentage.- See Also:
- Constant Field Values
-
DEFAULT_FONT_COLOR
public static final IsColor DEFAULT_FONT_COLOR
Default color of render, rgb(128, 128, 128)
-
-
Method Detail
-
isPercentage
public boolean isPercentage()
Returnstrue
if the value will be rendered as percentage.- Returns:
true
if the value will be rendered as percentage
-
setPercentage
public void setPercentage(boolean percentage)
Setstrue
if the value will be rendered as percentage.- Parameters:
percentage
-true
if the value will be rendered as percentage
-
getPrecision
public int getPrecision()
Returns the decimal places to apply to render the value.- Returns:
- the decimal places to apply to the value in chart
-
setPrecision
public 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
-
isAnimated
public boolean isAnimated()
Returns if the render will be shown based on the animation of chart.- Returns:
- the
true
the rendering is animated, otherwisefalse
-
setAnimated
public void setAnimated(boolean animated)
Sets if the render will be shown based on the animation of chart.- Parameters:
animated
-true
if the rendering is animated, otherwisefalse
-
getFormatCallback
public MeterFormatCallback getFormatCallback()
Returns the callback to customize the value string in the chart.- Returns:
- the callback to customize the value string in the chart
-
setFormatCallback
public 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
-
setDisplay
public final void setDisplay(boolean display)
Setstrue
whether the element label should be displayed.- Parameters:
display
-true
whether the element label should be displayed
-
isDisplay
public final boolean isDisplay()
Returnstrue
whether the element label should be displayed.- Returns:
true
whether the element label should be displayed
-
getFont
public final IsFont getFont()
Returns the font of the label.- Returns:
- the font of the label
-
isAutoFontSize
public final boolean isAutoFontSize()
Returnstrue
if the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.- Returns:
true
if the font size of the rendering will be automatically calculated, based on dimension of the area for rendering
-
setAutoFontSize
public final void setAutoFontSize(boolean autoFontSize)
Setstrue
if the font size of the rendering will be automatically calculated, based on dimension of the area for rendering.- Parameters:
autoFontSize
-true
if the font size of the rendering will be automatically calculated, based on dimension of the area for rendering
-
setColor
public final void setColor(String color)
Sets the font color of the label.- Parameters:
color
- the font color of the label
-
setColor
public final void setColor(IsColor color)
Sets the font color of the label.- Parameters:
color
- the font color of the label
-
getColorAsString
public final String getColorAsString()
Returns the font color of the label.- Returns:
- the font color of the label
-
getColor
public final IsColor getColor()
Returns the font color of the label.- Returns:
- the font color of the label
-
getColorCallback
public 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
-
setColor
public 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
-
getFontCallback
public 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
-
setFont
public 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
-
-