Class RadialPointLabels
- java.lang.Object
-
- org.pepstock.charba.client.configuration.RadialPointLabels
-
- All Implemented Interfaces:
IsScriptableFontProvider<ScaleContext>
public class RadialPointLabels extends Object implements IsScriptableFontProvider<ScaleContext>
It is used to configure the point labels that are shown on the perimeter of the scale.
Note that these options only apply if display is true.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Axis
getAxis()
Returns the axis instance.IsColor
getBackdropColor()
Returns the background color of the point label.String
getBackdropColorAsString()
Returns the background color of the point label.ColorCallback<ScaleContext>
getBackdropColorCallback()
Returns the backdrop color callback, if set, otherwisenull
.Padding
getBackdropPadding()
Returns the padding of label backdrop.int
getBorderRadius()
Returns the border radius (in pixels).BarBorderRadius
getBorderRadiusAsObject()
Returns the border radius (in pixels).BorderRadiusCallback<ScaleContext>
getBorderRadiusCallback()
Returns the callback called to set the border radius.PointLabelCallback
getCallback()
Returns the user callback to change point labels.IsColor
getColor()
Returns the font color.String
getColorAsString()
Returns the font color as string.ColorCallback<ScaleContext>
getColorCallback()
Returns the color callback, if set, otherwisenull
.Display
getDisplay()
The display option controls the visibility of labels.
Controls the axis global visibility (visible when true, hidden when false).Font
getFont()
Returns the font element.FontCallback<ScaleContext>
getFontCallback()
Returns the font callback, if set, otherwisenull
.int
getPadding()
Returns the padding between chart and point labels, in pixels.SimplePaddingCallback
getPaddingCallback()
Returns the padding callback, if set, otherwisenull
.boolean
isCentered()
Returns if point labels are centered.void
setBackdropColor(String backdropColor)
Sets the background color of the point label.void
setBackdropColor(ColorCallback<ScaleContext> backdropColorCallback)
Sets the backdrop color callback.void
setBackdropColor(NativeCallback backdropColorCallback)
Sets the backdrop color callback.void
setBackdropColor(IsColor backdropColor)
Sets the background color of the point label.void
setBorderRadius(int radius)
Sets the border radius.void
setBorderRadius(BorderRadiusCallback<ScaleContext> borderRadiusCallback)
Sets the callback to set the border radius.void
setBorderRadius(NativeCallback borderRadiusCallback)
Sets the callback to set the border radius.void
setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).void
setCallback(PointLabelCallback callback)
Sets the user callback to change point labels.void
setCentered(boolean centered)
Setstrue
if point labels are centered.void
setColor(String color)
Sets the font color.void
setColor(ColorCallback<ScaleContext> colorCallback)
Sets the color callback.void
setColor(NativeCallback colorCallback)
Sets the color callback.void
setColor(IsColor color)
Sets the font color.void
setDisplay(boolean display)
If true, labels are shownvoid
setDisplay(Display display)
The display option controls the visibility of labels.
Controls the axis global visibility (visible when true, hidden when false).void
setFont(FontCallback<ScaleContext> fontCallback)
Sets the font callback.void
setFont(NativeCallback fontCallback)
Sets the font callback.void
setPadding(int padding)
Sets the padding between chart and point labels, in pixels.void
setPadding(NativeCallback paddingCallback)
Sets the padding callback.void
setPadding(SimplePaddingCallback paddingCallback)
Sets the padding callback.
-
-
-
Method Detail
-
getBackdropPadding
public Padding getBackdropPadding()
Returns the padding of label backdrop.- Returns:
- padding of label backdrop.
-
getFont
public Font getFont()
Returns the font element.- Returns:
- the font element
-
setColor
public void setColor(IsColor color)
Sets the font color.- Parameters:
color
- font color.
-
setColor
public void setColor(String color)
Sets the font color.- Parameters:
color
- font color.
-
getColorAsString
public String getColorAsString()
Returns the font color as string.- Returns:
- font color as string
-
getColor
public IsColor getColor()
Returns the font color.- Returns:
- font color
-
setDisplay
public void setDisplay(boolean display)
If true, labels are shown- Parameters:
display
- if true, labels are shown
-
setDisplay
public void setDisplay(Display display)
The display option controls the visibility of labels.
Controls the axis global visibility (visible when true, hidden when false). When display: 'auto', the labels are visible only if there is enough space to draw them.- Parameters:
display
- display option controls the visibility of labels
-
getDisplay
public Display getDisplay()
The display option controls the visibility of labels.
Controls the axis global visibility (visible when true, hidden when false). When display: 'auto', the labels are visible only if there is enough space to draw them.- Returns:
- display option controls the visibility of labels
-
setPadding
public void setPadding(int padding)
Sets the padding between chart and point labels, in pixels.- Parameters:
padding
- the padding between chart and point labels, in pixels.
-
getPadding
public int getPadding()
Returns the padding between chart and point labels, in pixels.- Returns:
- the padding between chart and point labels, in pixels.
-
setBackdropColor
public void setBackdropColor(IsColor backdropColor)
Sets the background color of the point label.- Parameters:
backdropColor
- the background color of the point label
-
setBackdropColor
public void setBackdropColor(String backdropColor)
Sets the background color of the point label.- Parameters:
backdropColor
- the background color of the point label
-
getBackdropColorAsString
public String getBackdropColorAsString()
Returns the background color of the point label.- Returns:
- the background color of the point label
-
getBackdropColor
public IsColor getBackdropColor()
Returns the background color of the point label.- Returns:
- the background color of the point label
-
setCentered
public void setCentered(boolean centered)
Setstrue
if point labels are centered.- Parameters:
centered
-true
if point labels are centered.
-
isCentered
public boolean isCentered()
Returns if point labels are centered.- Returns:
- if point labels are centered
-
getCallback
public PointLabelCallback getCallback()
Returns the user callback to change point labels.- Returns:
- the callback
-
setCallback
public void setCallback(PointLabelCallback callback)
Sets the user callback to change point labels.- Parameters:
callback
- the callback to set
-
setBorderRadius
public void setBorderRadius(int radius)
Sets the border radius.- Parameters:
radius
- the border radius.
-
setBorderRadius
public void setBorderRadius(BarBorderRadius borderRadius)
Sets the border radius (in pixels).- Parameters:
borderRadius
- the border radius (in pixels).
-
getBorderRadius
public int getBorderRadius()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
getBorderRadiusAsObject
public BarBorderRadius getBorderRadiusAsObject()
Returns the border radius (in pixels).- Returns:
- the border radius (in pixels).
-
getFontCallback
public FontCallback<ScaleContext> getFontCallback()
Returns the font callback, if set, otherwisenull
.- Specified by:
getFontCallback
in interfaceIsScriptableFontProvider<ScaleContext>
- Returns:
- the font callback, if set, otherwise
null
.
-
setFont
public void setFont(FontCallback<ScaleContext> fontCallback)
Sets the font callback.- Specified by:
setFont
in interfaceIsScriptableFontProvider<ScaleContext>
- Parameters:
fontCallback
- the font callback to set
-
setFont
public void setFont(NativeCallback fontCallback)
Sets the font callback.- Specified by:
setFont
in interfaceIsScriptableFontProvider<ScaleContext>
- Parameters:
fontCallback
- the font callback to set
-
getPaddingCallback
public SimplePaddingCallback getPaddingCallback()
Returns the padding callback, if set, otherwisenull
.- Returns:
- the padding callback, if set, otherwise
null
.
-
setPadding
public void setPadding(SimplePaddingCallback paddingCallback)
Sets the padding callback.- Parameters:
paddingCallback
- the padding callback to set
-
setPadding
public void setPadding(NativeCallback paddingCallback)
Sets the padding callback.- Parameters:
paddingCallback
- the padding callback to set
-
getColorCallback
public ColorCallback<ScaleContext> getColorCallback()
Returns the color callback, if set, otherwisenull
.- Returns:
- the color callback, if set, otherwise
null
.
-
setColor
public void setColor(ColorCallback<ScaleContext> colorCallback)
Sets the color callback.- Parameters:
colorCallback
- the color callback to set
-
setColor
public void setColor(NativeCallback colorCallback)
Sets the color callback.- Parameters:
colorCallback
- the color callback to set
-
getBackdropColorCallback
public ColorCallback<ScaleContext> getBackdropColorCallback()
Returns the backdrop color callback, if set, otherwisenull
.- Returns:
- the backdrop color callback, if set, otherwise
null
.
-
setBackdropColor
public void setBackdropColor(ColorCallback<ScaleContext> backdropColorCallback)
Sets the backdrop color callback.- Parameters:
backdropColorCallback
- the backdrop color callback to set
-
setBackdropColor
public void setBackdropColor(NativeCallback backdropColorCallback)
Sets the backdrop color callback.- Parameters:
backdropColorCallback
- the backdrop color callback to set
-
getBorderRadiusCallback
public BorderRadiusCallback<ScaleContext> getBorderRadiusCallback()
Returns the callback called to set the border radius.- Returns:
- the callback called to set the border radius
-
setBorderRadius
public void setBorderRadius(BorderRadiusCallback<ScaleContext> borderRadiusCallback)
Sets the callback to set the border radius.- Parameters:
borderRadiusCallback
- to set the border radius
-
setBorderRadius
public void setBorderRadius(NativeCallback borderRadiusCallback)
Sets the callback to set the border radius.- Parameters:
borderRadiusCallback
- to set the border radius
-
getAxis
public final Axis getAxis()
Returns the axis instance.- Returns:
- the axis
-
-