Class LegendLabels
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.AbstractModel<Legend,IsDefaultLegendLabels>
-
- org.pepstock.charba.client.options.LegendLabels
-
- All Implemented Interfaces:
IsDefaultBoxHandler
,IsDefaultFontContainer
,IsDefaultLegendLabels
,IsDefaultPointStyleHandler
,HasFont
public final class LegendLabels extends AbstractModel<Legend,IsDefaultLegendLabels> implements IsDefaultLegendLabels, HasFont
This is the labels configuration of the legend.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description org.pepstock.charba.client.options.BoxHandler
getBoxHandler()
default int
getBoxHeight()
Returns the height of colored box.default int
getBoxWidth()
Returns the width of colored box.FontContainer
getFontContainer()
Returns a font container instance to use in the default methods of this interface.int
getPadding()
Returns the padding to apply around labels.default PointStyle
getPointStyle()
Returns the style of the point.default Canvas
getPointStyleAsCanvas()
Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull
.default Img
getPointStyleAsImage()
Returns the style of the point as image.
If property is missing or not an image, returnsnull
.org.pepstock.charba.client.options.PointStyleHandler
getPointStyleHandler()
default PointStyleType
getPointStyleType()
Returns the type of point style.TextAlign
getTextAlign()
Returns the horizontal alignment of the label text.boolean
isUsePointStyle()
Returns if label style will match corresponding point style (size is based on font size, boxWidth is not used in this case).default void
setBoxHeight(int boxHeight)
Sets the height of colored box.default void
setBoxWidth(int boxWidth)
Sets the width of colored box.void
setPadding(int padding)
Sets the padding to apply around labels.default void
setPointStyle(Canvas pointStyle)
Sets the style of the point as canvas.default void
setPointStyle(Img pointStyle)
Sets the style of the point as image.default void
setPointStyle(PointStyle pointStyle)
Sets the style of the point.void
setTextAlign(TextAlign align)
Sets the horizontal alignment of the label text.void
setUsePointStyle(boolean usePointStyle)
Sets if label style will match corresponding point style (size is based on font size, boxWidth is not used in this case).-
Methods inherited from class org.pepstock.charba.client.options.AbstractModel
getDefaultValues, getParent, loadPadding, setCallbackToModel, setCallbackToModel, setEventToModel
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, 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.NativeObjectContainer
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, 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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
getBoxHandler
public org.pepstock.charba.client.options.BoxHandler getBoxHandler()
-
getPointStyleHandler
public org.pepstock.charba.client.options.PointStyleHandler getPointStyleHandler()
-
getFontContainer
public FontContainer getFontContainer()
Description copied from interface:HasFont
Returns a font container instance to use in the default methods of this interface.- Specified by:
getFontContainer
in interfaceHasFont
- Returns:
- a font container instance
-
setUsePointStyle
public void setUsePointStyle(boolean usePointStyle)
Sets if label style will match corresponding point style (size is based on font size, boxWidth is not used in this case).- Parameters:
usePointStyle
- if label style will match corresponding point style (size is based on font size, boxWidth is not used in this case).
-
isUsePointStyle
public boolean isUsePointStyle()
Returns if label style will match corresponding point style (size is based on font size, boxWidth is not used in this case).- Specified by:
isUsePointStyle
in interfaceIsDefaultLegendLabels
- Returns:
true
if label style will match corresponding point style (size is based on font size, boxWidth is not used in this case).
-
setPadding
public void setPadding(int padding)
Sets the padding to apply around labels. Only top and bottom are implemented.- Parameters:
padding
- padding to apply around labels. Only top and bottom are implemented.
-
getPadding
public int getPadding()
Returns the padding to apply around labels. Only top and bottom are implemented.- Specified by:
getPadding
in interfaceIsDefaultLegendLabels
- Returns:
- padding to apply around labels. Only top and bottom are implemented.
-
setTextAlign
public void setTextAlign(TextAlign align)
Sets the horizontal alignment of the label text.- Parameters:
align
- the horizontal alignment of the label text.
-
getTextAlign
public TextAlign getTextAlign()
Returns the horizontal alignment of the label text.- Specified by:
getTextAlign
in interfaceIsDefaultLegendLabels
- Returns:
- the horizontal alignment of the label text.
-
setBoxWidth
public default void setBoxWidth(int boxWidth)
Sets the width of colored box.- Parameters:
boxWidth
- width of colored box.
-
getBoxWidth
public default int getBoxWidth()
Returns the width of colored box.- Specified by:
getBoxWidth
in interfaceIsDefaultBoxHandler
- Returns:
- width of colored box.
-
setBoxHeight
public default void setBoxHeight(int boxHeight)
Sets the height of colored box.- Parameters:
boxHeight
- width of colored box.
-
getBoxHeight
public default int getBoxHeight()
Returns the height of colored box.- Specified by:
getBoxHeight
in interfaceIsDefaultBoxHandler
- Returns:
- height of colored box.
-
setPointStyle
public default void setPointStyle(PointStyle pointStyle)
Sets the style of the point.- Parameters:
pointStyle
- array of the style of the point.
-
getPointStyle
public default PointStyle getPointStyle()
Returns the style of the point.- Specified by:
getPointStyle
in interfaceIsDefaultPointStyleHandler
- Returns:
- the style of the point or
null
if point style is set as image
-
setPointStyle
public default void setPointStyle(Img pointStyle)
Sets the style of the point as image.- Parameters:
pointStyle
- image element of the style of the point as image.
-
getPointStyleType
public default PointStyleType getPointStyleType()
Returns the type of point style.- Specified by:
getPointStyleType
in interfaceIsDefaultPointStyleHandler
- Returns:
- the type of point style
-
getPointStyleAsImage
public default Img getPointStyleAsImage()
Returns the style of the point as image.
If property is missing or not an image, returnsnull
.- Specified by:
getPointStyleAsImage
in interfaceIsDefaultPointStyleHandler
- Returns:
- image of the style of the point as image.
If property is missing or not a image, returnsnull
.
-
setPointStyle
public default void setPointStyle(Canvas pointStyle)
Sets the style of the point as canvas.- Parameters:
pointStyle
- canvas element of the style of the point as canvas.
-
getPointStyleAsCanvas
public default Canvas getPointStyleAsCanvas()
Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull
.- Specified by:
getPointStyleAsCanvas
in interfaceIsDefaultPointStyleHandler
- Returns:
- image of the style of the point as canvas.
If property is missing or not a canvas, returnsnull
.
-
-