Class DefaultChartLegendLabels
- java.lang.Object
-
- org.pepstock.charba.client.defaults.chart.DefaultChartLegendLabels
-
- All Implemented Interfaces:
IsDefaultBoxHandler
,IsDefaultFontContainer
,IsDefaultLegendLabels
,IsDefaultPointStyleHandler
public final class DefaultChartLegendLabels extends Object implements IsDefaultLegendLabels
Defaults for legend labels option element, based on chart type.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBoxHeight()
Returns the height of colored box.int
getBoxWidth()
Returns the width of colored box.String
getColorAsString()
Returns the font color as string.IsDefaultFont
getFont()
Returns the font element.int
getPadding()
Returns the padding to apply around labels.PointStyle
getPointStyle()
Returns the style of the point.Canvas
getPointStyleAsCanvas()
Returns the style of the point as canvas.
If property is missing or not an canvas, returnsnull
.Img
getPointStyleAsImage()
Returns the style of the point as image.
If property is missing or not an image, returnsnull
.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 fontSize, boxWidth is not used in this case).
-
-
-
Method Detail
-
getColorAsString
public String getColorAsString()
Description copied from interface:IsDefaultFontContainer
Returns the font color as string.- Specified by:
getColorAsString
in interfaceIsDefaultFontContainer
- Returns:
- font color as string
-
getFont
public IsDefaultFont getFont()
Description copied from interface:IsDefaultFontContainer
Returns the font element.- Specified by:
getFont
in interfaceIsDefaultFontContainer
- Returns:
- the font
-
isUsePointStyle
public boolean isUsePointStyle()
Description copied from interface:IsDefaultLegendLabels
Returns if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).- Specified by:
isUsePointStyle
in interfaceIsDefaultLegendLabels
- Returns:
- if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
-
getPointStyle
public PointStyle getPointStyle()
Description copied from interface:IsDefaultPointStyleHandler
Returns the style of the point.- Specified by:
getPointStyle
in interfaceIsDefaultPointStyleHandler
- Returns:
- the style of the point.
-
getBoxWidth
public int getBoxWidth()
Description copied from interface:IsDefaultBoxHandler
Returns the width of colored box.- Specified by:
getBoxWidth
in interfaceIsDefaultBoxHandler
- Returns:
- width of colored box.
-
getBoxHeight
public int getBoxHeight()
Description copied from interface:IsDefaultBoxHandler
Returns the height of colored box.- Specified by:
getBoxHeight
in interfaceIsDefaultBoxHandler
- Returns:
- height of colored box.
-
getPadding
public int getPadding()
Description copied from interface:IsDefaultLegendLabels
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.
-
getPointStyleType
public PointStyleType getPointStyleType()
Description copied from interface:IsDefaultPointStyleHandler
Returns the type of point style.- Specified by:
getPointStyleType
in interfaceIsDefaultPointStyleHandler
- Returns:
- the type of point style
-
getPointStyleAsCanvas
public Canvas getPointStyleAsCanvas()
Description copied from interface:IsDefaultPointStyleHandler
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
.
-
getPointStyleAsImage
public Img getPointStyleAsImage()
Description copied from interface:IsDefaultPointStyleHandler
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
.
-
getTextAlign
public TextAlign getTextAlign()
Description copied from interface:IsDefaultLegendLabels
Returns the horizontal alignment of the label text.- Specified by:
getTextAlign
in interfaceIsDefaultLegendLabels
- Returns:
- the horizontal alignment of the label text.
-
-