public final class LegendLabelItem extends LegendItem
Modifier and Type | Class and Description |
---|---|
static class |
LegendLabelItem.LegendLabelItemFactory
Inner class to create legend label item by a native object.
|
LegendItem.LegendItemFactory
Constructor and Description |
---|
LegendLabelItem()
Standard constructor which wraps a new native java script object.
|
Modifier and Type | Method and Description |
---|---|
Gradient |
getFillStyleAsGradient()
Returns the fill style of the legend box as gradient.
|
Pattern |
getFillStyleAsPattern()
Returns the fill style of the legend box as pattern.
|
Gradient |
getStrokeStyleAsGradient()
Returns the stroke style of the legend box as gradient.
|
Pattern |
getStrokeStyleAsPattern()
Returns the stroke style of the legend box as pattern.
|
SafeHtml |
getTextAsHtml()
Returns the label that will be displayed, as HTML.
If is not HTML, returns UndefinedValues.STRING . |
boolean |
isHtmlText()
Returns
true if the text of legend item is HTML.This field is used ONLY by HtmlLegend plugin and not by CHART.js. |
void |
setDatasetIndex(int datasetIndex)
Sets the dataset index of the chart.
|
void |
setFillStyle(CanvasGradient gradient)
Sets the fill style of the legend box as canvas gradient.
|
void |
setFillStyle(CanvasPattern pattern)
Sets the fill style of the legend box as canvas pattern.
|
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 |
setFillStyle(IsColor color)
Sets the fill style of the legend box as color.
|
void |
setFillStyle(String color)
Sets the fill style of the legend box as color.
|
void |
setHidden(boolean hidden)
Sets true if this item represents a hidden dataset.
|
void |
setHtmlText(boolean htmlText)
Sets
true if the text of legend item is HTML.This field is used ONLY by HtmlLegend plugin and not by CHART.js. |
void |
setIndex(int index)
Sets the dataset 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(int lineDashOffset)
Sets the box border dash pattern offset or "phase".
|
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(Image pointStyle)
Sets the style of the point as image.
|
void |
setPointStyle(ImageElement pointStyle)
Sets the style (as image) of the legend box (only used if usePointStyle is true)
|
void |
setPointStyle(ImageResource pointStyle)
Sets the style of the point as image.
|
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(CanvasGradient gradient)
Sets the stroke style of the legend box as canvas gradient.
|
void |
setStrokeStyle(CanvasPattern 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.
|
void |
setStrokeStyle(IsColor color)
Sets the stroke style of the legend box as color.
|
void |
setStrokeStyle(String color)
Sets the stroke style of the legend box as color.
|
void |
setText(SafeHtml text)
Sets the label that will be displayed, as HTML.
This field is used ONLY by HtmlLegend plugin and not by CHART.js. |
void |
setText(String text)
Sets the label that will be displayed.
|
getDatasetIndex, getFillStyle, getFillStyleAsCanvasGradient, getFillStyleAsCanvasPattern, getIndex, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineWidth, getPointStyle, getPointStyleAsImage, getRotation, getStrokeStyle, getStrokeStyleAsCanvasGradient, getStrokeStyleAsCanvasPattern, getText, isFillStyleAsCanvasGradient, isFillStyleAsCanvasPattern, isFillStyleAsColor, isHidden, isPointStyleAsImage, isStrokeStyleAsCanvasGradient, isStrokeStyleAsCanvasPattern, isStrokeStyleAsColor
checkValue, empty, getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
public LegendLabelItem()
public void setDatasetIndex(int datasetIndex)
datasetIndex
- the dataset index of the chartpublic void setIndex(int index)
index
- the dataset index of the chart (for POLAR and PIE charts)public void setText(String text)
text
- the label that will be displayedpublic void setText(SafeHtml text)
HtmlLegend
plugin and not by CHART.js.text
- the label that will be displayed, as HTMLpublic boolean isHtmlText()
true
if the text of legend item is HTML.HtmlLegend
plugin and not by CHART.js.true
if the text of legend item is HTMLpublic SafeHtml getTextAsHtml()
UndefinedValues.STRING
. This field is used ONLY by HtmlLegend
plugin and not by
CHART.js.null
.public void setHtmlText(boolean htmlText)
true
if the text of legend item is HTML.HtmlLegend
plugin and not by CHART.js.htmlText
- true
if the text of legend item is HTMLpublic void setFillStyle(IsColor color)
color
- the fill style of the legend box as colorpublic void setFillStyle(String color)
color
- the fill style of the legend box as colorpublic void setFillStyle(CanvasPattern pattern)
pattern
- the fill style of the legend box as canvas patternpublic void setFillStyle(IsChart chart, Pattern pattern)
chart
- chart instance related to this legendpattern
- the fill style of the legend box as patternpublic Pattern getFillStyleAsPattern()
null
if is not a patternpublic void setFillStyle(CanvasGradient gradient)
gradient
- the fill style of the legend box as canvas gradientpublic void setFillStyle(IsChart chart, Gradient gradient)
chart
- chart instance related to this legendgradient
- the fill style of the legend box as gradientpublic Gradient getFillStyleAsGradient()
null
if is not a gradientpublic void setHidden(boolean hidden)
hidden
- true if this item represents a hidden dataset. Label will be rendered with a strike-through effectpublic void setLineCap(CapStyle style)
style
- how the end points of every box border are drawn.public void setLineDash(List<Integer> lineDash)
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.public void setLineDashOffset(int lineDashOffset)
lineDashOffset
- the box border dash pattern offset or "phase".public void setLineJoin(JoinStyle style)
style
- There are three possible values for this property: round, bevel and miter.public void setLineWidth(int lineWidth)
lineWidth
- the width of box border in pixels.public void setStrokeStyle(IsColor color)
color
- the stroke style of the legend box as colorpublic void setStrokeStyle(String color)
color
- the stroke style of the legend box as colorpublic void setStrokeStyle(CanvasPattern pattern)
pattern
- the stroke style of the legend box as canvas patternpublic void setStrokeStyle(IsChart chart, Pattern pattern)
chart
- chart instance related to this legendpattern
- the stroke style of the legend box as patternpublic Pattern getStrokeStyleAsPattern()
null
if is not a patternpublic void setStrokeStyle(CanvasGradient gradient)
gradient
- the stroke style of the legend box as canvas gradientpublic void setStrokeStyle(IsChart chart, Gradient gradient)
chart
- chart instance related to this legendgradient
- the stroke style of the legend box as gradientpublic Gradient getStrokeStyleAsGradient()
null
if is not a gradientpublic void setPointStyle(PointStyle style)
style
- the style of the legend boxpublic void setPointStyle(ImageResource pointStyle)
pointStyle
- image resource of the style of the point as image.public void setPointStyle(Image pointStyle)
pointStyle
- image resource of the style of the point as image.public void setPointStyle(ImageElement pointStyle)
pointStyle
- the style (as image) of the legend boxpublic void setRotation(double rotation)
rotation
- the rotation of the point in degrees