public final class LabelsOptions extends AbstractPluginCachedOptions
LabelsPlugin.ID
plugin options, both at chart and global level.Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ARC
Default to enable drawing label in arc, false.
|
static int |
DEFAULT_OUTSIDE_PADDING
Default padding when position is
Position.OUTSIDE , 2. |
static boolean |
DEFAULT_OVERLAP
Default to enable drawing label even it's overlap, true.
|
static Position |
DEFAULT_POSITION
Default position to draw label,
Position.DEFAULT . |
static int |
DEFAULT_PRECISION
Default the precision for percentage, 0.
|
static Render |
DEFAULT_RENDER
Default rendering (what data must be showed),
Render.VALUE . |
static int |
DEFAULT_SHADOW_BLUR
Default text shadow intensity, 6.
|
static String |
DEFAULT_SHADOW_COLOR
Default text shadow color, "rgba(0,0,0,0.3)".
|
static int |
DEFAULT_SHADOW_OFFSET_X
Default text shadow X offset, 3.
|
static int |
DEFAULT_SHADOW_OFFSET_Y
Default text shadow Y offset, 3.
|
static boolean |
DEFAULT_SHOW_ACTUAL_PERCENTAGES
Default to enable showing the real calculated percentages from the values,
false.
|
static boolean |
DEFAULT_SHOW_ZERO
Default to enable whether or not labels of value 0 are displayed, false.
|
static int |
DEFAULT_TEXT_MARGIN
Default the margin of text when position is
Position.OUTSIDE or Position.BORDER ,
2. |
static boolean |
DEFAULT_TEXT_SHADOW
Default to enable if draws text shadows under labels, false.
|
Constructor and Description |
---|
LabelsOptions()
Creates new
DataLabelsPlugin.ID plugin options. |
LabelsOptions(IsChart chart)
Creates new
LabelsPlugin.ID plugin options, relating to chart instance for default. |
Modifier and Type | Method and Description |
---|---|
IsColor |
getFontColor()
Returns the the font color as color.
|
String |
getFontColorAsString()
Returns the the font color as string.
|
FontColorCallback |
getFontColorCallback()
Returns the font color callback, if set, otherwise
null . |
String |
getFontFamily()
Returns the font family.
|
int |
getFontSize()
Returns the the font size.
|
FontStyle |
getFontStyle()
Returns the font style.
|
List<ImageElement> |
getImages()
Returns the images when
Render is Render.IMAGE . |
int |
getOutsidePadding()
Returns the padding when position is
Position.OUTSIDE . |
Position |
getPosition()
Returns the position to draw label.
|
int |
getPrecision()
Returns the precision for percentage.
|
Render |
getRender()
Returns what data must be showed.
|
RenderCallback |
getRenderCallback()
Returns the render callback, if set, otherwise
null . |
int |
getShadowBlur()
Returns the text shadow intensity.
|
IsColor |
getShadowColor()
Returns the text shadow color as color.
|
String |
getShadowColorAsString()
Returns the text shadow color as string.
|
int |
getShadowOffsetX()
Returns the text shadow X offset.
|
int |
getShadowOffsetY()
Returns the text shadow Y offset.
|
int |
getTextMargin()
Returns the margin of text when position is
Position.OUTSIDE or Position.BORDER . |
boolean |
isArc()
Returns if draws label in arc.
|
boolean |
isOverlap()
Returns if draws label even it's overlap.
|
boolean |
isShowActualPercentages()
Returns if shows the real calculated percentages from the values and don't apply the additional logic to fit the
percentages to 100 in total.
|
boolean |
isShowZero()
Returns whether or not labels of value 0 are displayed.
|
boolean |
isTextShadow()
Returns if draws text shadows under labels.
|
void |
setArc(boolean arc)
Sets if draws label in arc.
|
void |
setFontColor(FontColorCallback fontColorCallback)
Sets the font color callback.
|
void |
setFontColor(IsColor color)
Sets the font color as color.
|
void |
setFontColor(String color)
Sets the font color as string.
|
void |
setFontFamily(String fontFamily)
Sets the font family
|
void |
setFontSize(int size)
Sets the font size.
|
void |
setFontStyle(FontStyle fontStyle)
Sets the font style.
|
void |
setImages(Image... images)
Sets the images when
Render is Render.IMAGE . |
void |
setImages(ImageElement... images)
Sets the images when
Render is Render.IMAGE . |
void |
setImages(ImageResource... images)
Sets the images when
Render is Render.IMAGE . |
void |
setOutsidePadding(int outsidePadding)
Sets the padding when position is
Position.OUTSIDE . |
void |
setOverlap(boolean overlap)
Sets if draws label even it's overlap.
|
void |
setPosition(Position position)
+ Sets the position to draw label.
|
void |
setPrecision(int precision)
Sets the precision for percentage.
|
void |
setRender(Render render)
Sets what data must be showed.
|
void |
setRender(RenderCallback renderCallback)
Sets the render callback.
|
void |
setShadowBlur(int shadowBlur)
Sets the text shadow intensity.
|
void |
setShadowColor(IsColor shadowColor)
Sets the text shadow color as color.
|
void |
setShadowColor(String shadowColor)
Sets the text shadow color as string.
|
void |
setShadowOffsetX(int shadowOffsetX)
Sets the text shadow X offset.
|
void |
setShadowOffsetY(int shadowOffsetY)
Sets the text shadow Y offset.
|
void |
setShowActualPercentages(boolean showActualPercentages)
Sets if shows the real calculated percentages from the values and don't apply the additional logic to fit the percentages
to 100 in total.
|
void |
setShowZero(boolean showZero)
Sets whether or not labels of value 0 are displayed.
|
void |
setTextMargin(int textMargin)
Sets the margin of text when position is
Position.OUTSIDE or Position.BORDER . |
void |
setTextShadow(boolean textShadow)
Sets if draws text shadows under labels.
|
getInnerOptions, getReferences, register
getId, getPluginId, loadGlobalsPluginOptions, store, store, store, store
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 static final Render DEFAULT_RENDER
Render.VALUE
.public static final int DEFAULT_PRECISION
public static final boolean DEFAULT_SHOW_ZERO
public static final boolean DEFAULT_TEXT_SHADOW
public static final int DEFAULT_SHADOW_BLUR
public static final int DEFAULT_SHADOW_OFFSET_X
public static final int DEFAULT_SHADOW_OFFSET_Y
public static final String DEFAULT_SHADOW_COLOR
public static final boolean DEFAULT_ARC
public static final Position DEFAULT_POSITION
Position.DEFAULT
.public static final boolean DEFAULT_OVERLAP
public static final boolean DEFAULT_SHOW_ACTUAL_PERCENTAGES
public static final int DEFAULT_OUTSIDE_PADDING
Position.OUTSIDE
, 2.public static final int DEFAULT_TEXT_MARGIN
Position.OUTSIDE
or Position.BORDER
,
2.public LabelsOptions()
DataLabelsPlugin.ID
plugin options.public LabelsOptions(IsChart chart)
LabelsPlugin.ID
plugin options, relating to chart instance for default.chart
- chart instance related to the plugin optionspublic void setRender(Render render)
render
- what data must be showed.public Render getRender()
public void setPrecision(int precision)
precision
- the precision for percentagepublic int getPrecision()
public void setShowZero(boolean showZero)
showZero
- whether or not labels of value 0 are displayed.public boolean isShowZero()
public void setFontSize(int size)
size
- the font size.public int getFontSize()
public void setFontColor(IsColor color)
color
- the font color as color.public void setFontColor(String color)
color
- the font color as string.public String getFontColorAsString()
public IsColor getFontColor()
public void setFontStyle(FontStyle fontStyle)
fontStyle
- the font style.public FontStyle getFontStyle()
public void setFontFamily(String fontFamily)
fontFamily
- the font familypublic String getFontFamily()
public void setTextShadow(boolean textShadow)
textShadow
- true
if draws text shadows under labels.public boolean isTextShadow()
true
if draws text shadows under labels.public void setShadowBlur(int shadowBlur)
shadowBlur
- the text shadow intensity.public int getShadowBlur()
public void setShadowOffsetX(int shadowOffsetX)
shadowOffsetX
- the text shadow X offset.public int getShadowOffsetX()
public void setShadowOffsetY(int shadowOffsetY)
shadowOffsetY
- the text shadow Y offset.public int getShadowOffsetY()
public void setShadowColor(IsColor shadowColor)
shadowColor
- the text shadow color as color.public void setShadowColor(String shadowColor)
shadowColor
- the text shadow color as string.public String getShadowColorAsString()
public IsColor getShadowColor()
public void setArc(boolean arc)
arc
- if draws label in arc.public boolean isArc()
true
if draws label in arc.public void setPosition(Position position)
position
- the position to draw label.public Position getPosition()
public void setOverlap(boolean overlap)
overlap
- if draws label even it's overlap.public boolean isOverlap()
true
if draws label even it's overlap.public void setShowActualPercentages(boolean showActualPercentages)
showActualPercentages
- if shows the real calculated percentages from the values and don't apply the additional
logic to fit the percentages to 100 in total.public boolean isShowActualPercentages()
true
if shows the real calculated percentages from the values and don't apply the additional logic to
fit the percentages to 100 in total.public void setOutsidePadding(int outsidePadding)
Position.OUTSIDE
.outsidePadding
- the padding when position is Position.OUTSIDE
.public int getOutsidePadding()
Position.OUTSIDE
.Position.OUTSIDE
.public void setTextMargin(int textMargin)
Position.OUTSIDE
or Position.BORDER
.textMargin
- the margin of text when position is Position.OUTSIDE
or Position.BORDER
.public int getTextMargin()
Position.OUTSIDE
or Position.BORDER
.Position.OUTSIDE
or Position.BORDER
.public void setImages(ImageResource... images)
Render
is Render.IMAGE
.images
- images when Render
is Render.IMAGE
.public void setImages(Image... images)
Render
is Render.IMAGE
.images
- images when Render
is Render.IMAGE
.public void setImages(ImageElement... images)
Render
is Render.IMAGE
.images
- images when Render
is Render.IMAGE
.public List<ImageElement> getImages()
Render
is Render.IMAGE
.Render
is Render.IMAGE
or an empty list.public RenderCallback getRenderCallback()
null
.null
public void setRender(RenderCallback renderCallback)
renderCallback
- the render callback to setpublic FontColorCallback getFontColorCallback()
null
.null
public void setFontColor(FontColorCallback fontColorCallback)
fontColorCallback
- the font color callback.