Class LegendLabels
- java.lang.Object
-
- org.pepstock.charba.client.configuration.LegendLabels
-
public class LegendLabels extends Object
This is the labels configuration of the legend.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBoxHeight()Returns the height of colored box.intgetBoxWidth()Returns the width of colored box.IsChartgetChart()Returns the chart instanceIsColorgetColor()Returns the font color.StringgetColorAsString()Returns the font color as string.protected ExtendedOptionsgetConfiguration()Returns the configuration element.LegendFilterCallbackgetFilterCallback()Returns the user filter callback instance.FontgetFont()Returns the font element.LegendItemSortCallbackgetItemSortCallback()Returns the user item sort callback instance.LegendLabelsCallbackgetLabelsCallback()Returns the user callback instance to generate labels.protected ConfigurationOptionsgetOptions()Returns the configuration options.intgetPadding()Returns the padding to apply around labels.PointStylegetPointStyle()Returns the style of the legend.CanvasgetPointStyleAsCanvas()Returns the style of the point as canvas.ImggetPointStyleAsImage()Returns the style of the legend as image.PointStyleTypegetPointStyleType()Returns the type of point style.doublegetPointStyleWidth()Returns ifusePointStyleis true, the width of the point style used for the legend (only forPointStyle.CIRCLE,PointStyle.RECTandPointStyle.LINE).TextAligngetTextAlign()Returns the horizontal alignment of the label text.booleanisUsePointStyle()Returns if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).voidsetBoxHeight(int boxHeight)Sets the height of colored box.voidsetBoxWidth(int boxWidth)Sets the width of colored box.voidsetColor(String color)Sets the font color.voidsetColor(IsColor color)Sets the font color.voidsetFilterCallback(LegendFilterCallback filterCallback)Sets the user filter callback instance.voidsetItemSortCallback(LegendItemSortCallback itemSortCallback)Sets the user item sort callback instance.voidsetLabelsCallback(LegendLabelsCallback labelsCallback)Sets the user callback instance to generate labels.voidsetPadding(int padding)Sets the padding to apply around labels.voidsetPointStyle(Canvas pointStyle)Sets the style of the legend, overriding point style from dataset, as canvas.
Only applies ifsetUsePointStyle(boolean)is set totrue.voidsetPointStyle(Img pointStyle)Sets the style of the legend, overriding point style from dataset, as image.
Only applies ifsetUsePointStyle(boolean)is set totrue.voidsetPointStyle(PointStyle pointStyle)Sets the style of the legend, overriding point style from dataset.
Only applies ifsetUsePointStyle(boolean)is set totrue.voidsetPointStyleWidth(double pointStyleWidth)Sets ifusePointStyleis true, the width of the point style used for the legend (only forPointStyle.CIRCLE,PointStyle.RECTandPointStyle.LINE).voidsetTextAlign(TextAlign align)Sets the horizontal alignment of the label text.voidsetUsePointStyle(boolean usePointStyle)Sets if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
-
-
-
Method Detail
-
getFont
public Font getFont()
Returns the font element.- Returns:
- the font
-
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
-
setUsePointStyle
public void setUsePointStyle(boolean usePointStyle)
Sets if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).- Parameters:
usePointStyle- if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
-
isUsePointStyle
public boolean isUsePointStyle()
Returns if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).- Returns:
- if label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
-
setPointStyleWidth
public void setPointStyleWidth(double pointStyleWidth)
Sets ifusePointStyleis true, the width of the point style used for the legend (only forPointStyle.CIRCLE,PointStyle.RECTandPointStyle.LINE).- Parameters:
pointStyleWidth- ifusePointStyleis true, the width of the point style used for the legend (only forPointStyle.CIRCLE,PointStyle.RECTandPointStyle.LINE).
-
getPointStyleWidth
public double getPointStyleWidth()
Returns ifusePointStyleis true, the width of the point style used for the legend (only forPointStyle.CIRCLE,PointStyle.RECTandPointStyle.LINE).- Returns:
- if
usePointStyleis true, the width of the point style used for the legend (only forPointStyle.CIRCLE,PointStyle.RECTandPointStyle.LINE).
-
setPointStyle
public void setPointStyle(PointStyle pointStyle)
Sets the style of the legend, overriding point style from dataset.
Only applies ifsetUsePointStyle(boolean)is set totrue.- Parameters:
pointStyle- the style of the legend, overriding point style from dataset.
-
setPointStyle
public void setPointStyle(Img pointStyle)
Sets the style of the legend, overriding point style from dataset, as image.
Only applies ifsetUsePointStyle(boolean)is set totrue.- Parameters:
pointStyle- the style of the legend, overriding point style from dataset.
-
setPointStyle
public void setPointStyle(Canvas pointStyle)
Sets the style of the legend, overriding point style from dataset, as canvas.
Only applies ifsetUsePointStyle(boolean)is set totrue.- Parameters:
pointStyle- the style of the legend, overriding point style from dataset.
-
getPointStyleType
public PointStyleType getPointStyleType()
Returns the type of point style.- Returns:
- the type of point style
-
getPointStyle
public PointStyle getPointStyle()
Returns the style of the legend.- Returns:
- the style of the legend.
-
getPointStyleAsCanvas
public Canvas getPointStyleAsCanvas()
Returns the style of the point as canvas.- Returns:
- the style of the point as canvas.
-
getPointStyleAsImage
public Img getPointStyleAsImage()
Returns the style of the legend as image.- Returns:
- the style of the legend as image.
-
setBoxWidth
public void setBoxWidth(int boxWidth)
Sets the width of colored box.- Parameters:
boxWidth- width of colored box.
-
getBoxWidth
public int getBoxWidth()
Returns the width of colored box.- Returns:
- width of colored box.
-
setBoxHeight
public void setBoxHeight(int boxHeight)
Sets the height of colored box.- Parameters:
boxHeight- height of colored box.
-
getBoxHeight
public int getBoxHeight()
Returns the height of colored box.- Returns:
- height of colored box.
-
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.- 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.- Returns:
- the horizontal alignment of the label text.
-
getFilterCallback
public LegendFilterCallback getFilterCallback()
Returns the user filter callback instance.- Returns:
- the user filter callback instance
-
setFilterCallback
public void setFilterCallback(LegendFilterCallback filterCallback)
Sets the user filter callback instance.- Parameters:
filterCallback- the user filter callback instance
-
getLabelsCallback
public LegendLabelsCallback getLabelsCallback()
Returns the user callback instance to generate labels.- Returns:
- the user callback instance to generate labels
-
setLabelsCallback
public void setLabelsCallback(LegendLabelsCallback labelsCallback)
Sets the user callback instance to generate labels.- Parameters:
labelsCallback- the user callback instance to generate labels
-
getItemSortCallback
public LegendItemSortCallback getItemSortCallback()
Returns the user item sort callback instance.- Returns:
- the user item sort callback instance
-
setItemSortCallback
public void setItemSortCallback(LegendItemSortCallback itemSortCallback)
Sets the user item sort callback instance.- Parameters:
itemSortCallback- the user item sort callback instance
-
getOptions
protected final ConfigurationOptions getOptions()
Returns the configuration options.- Returns:
- the configuration options.
-
getConfiguration
protected final ExtendedOptions getConfiguration()
Returns the configuration element.- Returns:
- the configuration element.
-
getChart
public final IsChart getChart()
Returns the chart instance- Returns:
- the chart
-
-