Package org.pepstock.charba.client.items
Class LegendLabelItem
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.items.LegendItem
-
- org.pepstock.charba.client.items.LegendLabelItem
-
- All Implemented Interfaces:
HasLegendText
public final class LegendLabelItem extends LegendItem implements HasLegendText
This object is created by callbacks and returned to CHART.JS as native object to configure the legend.- Author:
- Andrea "Stock" Stocchero
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LegendLabelItem.LegendLabelItemFactory
Inner class to create legend label item by a native object.-
Nested classes/interfaces inherited from class org.pepstock.charba.client.items.LegendItem
LegendItem.LegendItemFactory
-
-
Field Summary
Fields Modifier and Type Field Description static LegendLabelItem.LegendLabelItemFactory
FACTORY
Public factory to create a legend labels item from a native object.
-
Constructor Summary
Constructors Constructor Description LegendLabelItem()
Standard constructor which wraps a new native java script object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LegendTextHandler
getLegendTextHandler()
Returns a legend text handler instance to use in the default methods of this interface.void
setDatasetIndex(int datasetIndex)
Sets the data set index of the chart.void
setFillStyle(String color)
Sets the fill style of the legend box as color.void
setFillStyle(IsColor color)
Sets the fill style of the legend box as color.void
setFillStyle(IsChart chart, Gradient gradient)
Sets the fill style of the legend box as gradient.void
setFillStyle(IsChart chart, Pattern pattern)
Sets the fill style of the legend box as pattern.void
setFontColor(String color)
Returns the font color of the legend.void
setFontColor(IsColor color)
Sets the font color of the legend.void
setIndex(int index)
Sets the data set index of the chart (for POLAR and PIE charts).void
setLineCap(CapStyle style)
Sets how the end points of every box border are drawn.void
setLineDash(List<Integer> lineDash)
Sets the box border dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.void
setLineDashOffset(double lineDashOffset)
Sets the box border dash pattern offset.void
setLineJoin(JoinStyle style)
Sets how two connecting segments (of box border) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).
There are three possible values for this property: round, bevel and miter.void
setLineWidth(int lineWidth)
Sets the width of box border in pixels.void
setPointStyle(Canvas pointStyle)
Sets the style (as canvas) of the legend box (only used if usePointStyle is true)void
setPointStyle(Img pointStyle)
Sets the style (as image) of the legend box (only used if usePointStyle is true)void
setPointStyle(PointStyle style)
Sets the style of the legend box (only used if usePointStyle is true)void
setRotation(double rotation)
Sets the rotation of the point in degrees (only used if usePointStyle is true).void
setStrokeStyle(String color)
Sets the stroke style of the legend box as color.void
setStrokeStyle(IsColor color)
Sets the stroke style of the legend box as color.void
setStrokeStyle(CanvasGradientItem gradient)
Sets the stroke style of the legend box as canvas gradient.void
setStrokeStyle(CanvasPatternItem pattern)
Sets the stroke style of the legend box as canvas pattern.void
setStrokeStyle(IsChart chart, Gradient gradient)
Sets the stroke style of the legend box as gradient.void
setStrokeStyle(IsChart chart, Pattern pattern)
Sets the stroke style of the legend box as pattern.-
Methods inherited from class org.pepstock.charba.client.items.LegendItem
getBorderRadius, getDatasetIndex, getFillStyle, getFillStyleAsCanvasGradient, getFillStyleAsCanvasPattern, getFillStyleAsGradient, getFillStyleAsPattern, getFontColor, getIndex, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineWidth, getPointStyle, getPointStyleAsCanvas, getPointStyleAsImage, getPointStyleType, getRotation, getStrokeStyle, getStrokeStyleAsCanvasGradient, getStrokeStyleAsCanvasPattern, getStrokeStyleAsGradient, getStrokeStyleAsPattern, getText, isFillStyleAsColor, isFillStyleAsGradient, isFillStyleAsPattern, isHidden, isStrokeStyleAsColor, isStrokeStyleAsGradient, isStrokeStyleAsPattern
-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, 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, 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, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.items.HasLegendText
getText, getTextAsHtml, isHtmlText, setHtmlText, setText, setText
-
-
-
-
Field Detail
-
FACTORY
public static final LegendLabelItem.LegendLabelItemFactory FACTORY
Public factory to create a legend labels item from a native object.
-
-
Method Detail
-
getLegendTextHandler
public LegendTextHandler getLegendTextHandler()
Description copied from interface:HasLegendText
Returns a legend text handler instance to use in the default methods of this interface.- Specified by:
getLegendTextHandler
in interfaceHasLegendText
- Returns:
- a legend text handler instance
-
setDatasetIndex
public void setDatasetIndex(int datasetIndex)
Sets the data set index of the chart.- Parameters:
datasetIndex
- the data set index of the chart
-
setIndex
public void setIndex(int index)
Sets the data set index of the chart (for POLAR and PIE charts).- Parameters:
index
- the data set index of the chart (for POLAR and PIE charts)
-
setFontColor
public void setFontColor(IsColor color)
Sets the font color of the legend.- Parameters:
color
- the font color of the legend
-
setFontColor
public void setFontColor(String color)
Returns the font color of the legend.- Parameters:
color
- the font color of the legend
-
setFillStyle
public void setFillStyle(IsColor color)
Sets the fill style of the legend box as color.- Parameters:
color
- the fill style of the legend box as color
-
setFillStyle
public void setFillStyle(String color)
Sets the fill style of the legend box as color.- Parameters:
color
- the fill style of the legend box as color
-
setFillStyle
public void setFillStyle(IsChart chart, Pattern pattern)
Sets the fill style of the legend box as pattern.- Parameters:
chart
- chart instance related to this legendpattern
- the fill style of the legend box as pattern
-
setFillStyle
public void setFillStyle(IsChart chart, Gradient gradient)
Sets the fill style of the legend box as gradient.- Parameters:
chart
- chart instance related to this legendgradient
- the fill style of the legend box as gradient
-
setLineCap
public void setLineCap(CapStyle style)
Sets how the end points of every box border are drawn. There are three possible values for this property and those are: butt, round and square.- Parameters:
style
- how the end points of every box border are drawn.
-
setLineDash
public void setLineDash(List<Integer> lineDash)
Sets the box border dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.- Parameters:
lineDash
- the box border dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
-
setLineDashOffset
public void setLineDashOffset(double lineDashOffset)
Sets the box border dash pattern offset.- Parameters:
lineDashOffset
- the box border dash pattern offset.
-
setLineJoin
public void setLineJoin(JoinStyle style)
Sets how two connecting segments (of box border) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).
There are three possible values for this property: round, bevel and miter.- Parameters:
style
- There are three possible values for this property: round, bevel and miter.
-
setLineWidth
public void setLineWidth(int lineWidth)
Sets the width of box border in pixels.- Parameters:
lineWidth
- the width of box border in pixels.
-
setStrokeStyle
public void setStrokeStyle(IsColor color)
Sets the stroke style of the legend box as color.- Parameters:
color
- the stroke style of the legend box as color
-
setStrokeStyle
public void setStrokeStyle(String color)
Sets the stroke style of the legend box as color.- Parameters:
color
- the stroke style of the legend box as color
-
setStrokeStyle
public void setStrokeStyle(CanvasPatternItem pattern)
Sets the stroke style of the legend box as canvas pattern.- Parameters:
pattern
- the stroke style of the legend box as canvas pattern
-
setStrokeStyle
public void setStrokeStyle(IsChart chart, Pattern pattern)
Sets the stroke style of the legend box as pattern.- Parameters:
chart
- chart instance related to this legendpattern
- the stroke style of the legend box as pattern
-
setStrokeStyle
public void setStrokeStyle(CanvasGradientItem gradient)
Sets the stroke style of the legend box as canvas gradient.- Parameters:
gradient
- the stroke style of the legend box as canvas gradient
-
setStrokeStyle
public void setStrokeStyle(IsChart chart, Gradient gradient)
Sets the stroke style of the legend box as gradient.- Parameters:
chart
- chart instance related to this legendgradient
- the stroke style of the legend box as gradient
-
setPointStyle
public void setPointStyle(PointStyle style)
Sets the style of the legend box (only used if usePointStyle is true)- Parameters:
style
- the style of the legend box
-
setPointStyle
public void setPointStyle(Img pointStyle)
Sets the style (as image) of the legend box (only used if usePointStyle is true)- Parameters:
pointStyle
- the style (as image) of the legend box
-
setPointStyle
public void setPointStyle(Canvas pointStyle)
Sets the style (as canvas) of the legend box (only used if usePointStyle is true)- Parameters:
pointStyle
- the style (as canvas) of the legend box
-
setRotation
public void setRotation(double rotation)
Sets the rotation of the point in degrees (only used if usePointStyle is true).- Parameters:
rotation
- the rotation of the point in degrees
-
-