public class Options extends NativeObjectContainer implements IsDefaultOptions
Modifier | Constructor and Description |
---|---|
protected |
Options(IsDefaultOptions defaultValues)
Creates the object only with default provider.
|
protected |
Options(IsDefaultOptions defaultValues,
NativeObject nativeObject)
Creates the object only with default provider and native object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkAndAddToParent()
Called recursively when a property has been set in the item.
This is mandatory because it could happen that the parent item is not present, therefore it must be added. |
Animation |
getAnimation()
Returns the animation element.
|
double |
getAspectRatio()
Canvas aspect ratio (i.e.
|
String |
getCharbaId()
Returns the CHARBA id when the options are related to a chart instance.
|
protected Key |
getChildKey()
Returns the property name to use to add this element to its parent.
|
double |
getCircumference()
Returns the the sweep to allow arcs to cover.
|
double |
getCutoutPercentage()
Returns the the percentage of the chart that is cut out of the middle.
|
IsColor |
getDefaultColor()
Returns the default color to use in the chart, on all objects, if not override by the specific configuration.
|
String |
getDefaultColorAsString()
Returns the default color to use in the chart, on all objects, if not override by the specific configuration.
|
IsColor |
getDefaultFontColor()
Returns the default font color to use in the chart, on all objects, if not override by the specific configuration.
|
String |
getDefaultFontColorAsString()
Returns the default font color to use in the chart, on all objects, if not override by the specific configuration.
|
String |
getDefaultFontFamily()
Returns the font family to use in the chart, on all objects, if not override by the specific configuration, follows CSS
font-family options.
|
int |
getDefaultFontSize()
Returns the font size to use in the chart, on all objects, if not override by the specific configuration.
|
FontStyle |
getDefaultFontStyle()
Returns the font style to use in the chart, on all objects, if not override by the specific configuration, follows CSS
font-style options (i.e.
|
double |
getDefaultLineHeight()
Returns the height of an individual line of text.
|
protected D |
getDefaultValues()
Returns the default provider instance.
|
double |
getDevicePixelRatio()
The chart's canvas will use a 1:1 pixel ratio, unless the physical display has a higher pixel ratio (e.g.
|
Elements |
getElements()
Returns the elements element.
|
List<Event> |
getEvents()
Returns the browser events that the chart should listen to for tooltips and hovering.
|
Hover |
getHover()
Returns the hover element.
|
Layout |
getLayout()
Returns the layout element.
|
Legend |
getLegend()
Returns the legend element.
|
protected P |
getParent()
Returns the parent element.
|
Plugins |
getPlugins()
Returns the plugins element.
|
int |
getResponsiveAnimationDuration()
Returns the duration in milliseconds it takes to animate to new size after a resize event.
|
double |
getRotation()
Returns the starting angle to draw arcs from.
|
double |
getStartAngle()
Returns the starting angle to draw arcs for the first item in a dataset.
|
Title |
getTitle()
Returns the title element.
|
Tooltips |
getTooltips()
Returns the tooltips element.
|
boolean |
isDestroyOnDetach()
Returns
true if the chart is configured to be destroyed on the detach from DIV element, otherwise
false . |
boolean |
isDrawOnAttach()
Returns
true if the chart is configured to be drawn on the attach of DIV element, otherwise
false . |
boolean |
isMaintainAspectRatio()
Returns the the maintaining of the original canvas aspect ratio (width / height) when resizing.
|
boolean |
isResponsive()
Returns the resizing of the chart canvas when its container does.
|
boolean |
isShowLines()
If
false , the lines between points are not drawn. |
boolean |
isSpanGaps()
If
false , NaN data causes a break in the line. |
void |
setAspectRatio(double ratio)
Canvas aspect ratio (i.e.
|
protected void |
setCallbackToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for callbacks) to a model at the specific key.
|
void |
setCircumference(double circumference)
Sets the sweep to allow arcs to cover.
|
void |
setCutoutPercentage(double cutoutPercentage)
Sets the percentage of the chart that is cut out of the middle.
|
void |
setDefaultColor(IsColor defaultColor)
Sets the default color to use in the chart, on all objects, if not override by the specific configuration.
|
void |
setDefaultColor(String defaultColor)
Sets the default color to use in the chart, on all objects, if not override by the specific configuration.
|
void |
setDefaultFontColor(IsColor defaultFontColor)
Sets the default font color to use in the chart, on all objects, if not override by the specific configuration.
|
void |
setDefaultFontColor(String defaultFontColor)
Sets the default font color to use in the chart, on all objects, if not override by the specific configuration.
|
void |
setDefaultFontFamily(String fontFamily)
Sets the font family to use in the chart, on all objects, if not override by the specific configuration, follows CSS
font-family options.
|
void |
setDefaultFontSize(int fontSize)
Sets the font size to use in the chart, on all objects, if not override by the specific configuration.
|
void |
setDefaultFontStyle(FontStyle fontStyle)
Sets the font style to use in the chart, on all objects, if not override by the specific configuration, follows CSS
font-style options (i.e.
|
void |
setDefaultLineHeight(double lineHeight)
Sets the height of an individual line of text.
|
void |
setDestroyOnDetach(boolean destroyOnDetach)
Sets
true if the chart is configured to be destroyed on the detach from DIV element, otherwise
false . |
void |
setDevicePixelRatio(double ratio)
The chart's canvas will use a 1:1 pixel ratio, unless the physical display has a higher pixel ratio (e.g.
|
void |
setDrawOnAttach(boolean drawOnAttach)
Sets
true if the chart is configured to be draw on the attach of DIV element, otherwise false . |
void |
setEvents(Event... events)
Sets the browser events that the chart should listen to for tooltips and hovering.
|
protected void |
setEventToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model,
Key key,
CallbackProxy.Proxy proxy)
Adds a proxy function (for events) to a model at the specific key.
|
void |
setMaintainAspectRatio(boolean maintainAspectRatio)
Sets the maintaining of the original canvas aspect ratio (width / height) when resizing.
|
void |
setResponsive(boolean responsive)
Sets the resizing of the chart canvas when its container does.
|
void |
setResponsiveAnimationDuration(int milliseconds)
Sets the duration in milliseconds it takes to animate to new size after a resize event.
|
void |
setRotation(double rotation)
Sets the starting angle to draw arcs from.
|
void |
setShowLines(boolean showLine)
If
false , the lines between points are not drawn. |
void |
setSpanGaps(boolean spanGaps)
If
false , NaN data causes a break in the line. |
void |
setStartAngle(double startAngle)
Sets the starting angle to draw arcs for the first item in a dataset.
|
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
protected Options(IsDefaultOptions defaultValues)
defaultValues
- default provider instance.protected Options(IsDefaultOptions defaultValues, NativeObject nativeObject)
defaultValues
- default provider instance.nativeObject
- native object to store properties.public Animation getAnimation()
getAnimation
in interface IsDefaultOptions
public Legend getLegend()
getLegend
in interface IsDefaultOptions
public final Hover getHover()
getHover
in interface IsDefaultOptions
public final Layout getLayout()
getLayout
in interface IsDefaultOptions
public final Elements getElements()
getElements
in interface IsDefaultOptions
public final Title getTitle()
getTitle
in interface IsDefaultOptions
public final Tooltips getTooltips()
getTooltips
in interface IsDefaultOptions
public final Plugins getPlugins()
getPlugins
in interface IsDefaultOptions
public String getCharbaId()
UndefinedValues.STRING
.public void setEvents(Event... events)
events
- the browser events that the chart should listen to for tooltips and hovering.public List<Event> getEvents()
public void setResponsive(boolean responsive)
responsive
- the resizing of the chart canvas when its container does.public boolean isResponsive()
isResponsive
in interface IsDefaultOptions
public void setResponsiveAnimationDuration(int milliseconds)
milliseconds
- the duration in milliseconds it takes to animate to new size after a resize event.public int getResponsiveAnimationDuration()
getResponsiveAnimationDuration
in interface IsDefaultOptions
public void setMaintainAspectRatio(boolean maintainAspectRatio)
maintainAspectRatio
- the maintaining of the original canvas aspect ratio (width / height) when resizing.public boolean isMaintainAspectRatio()
isMaintainAspectRatio
in interface IsDefaultOptions
public void setAspectRatio(double ratio)
ratio
- the aspect ratio.public double getAspectRatio()
getAspectRatio
in interface IsDefaultOptions
public void setDevicePixelRatio(double ratio)
ratio
- the pixel ratio.public double getDevicePixelRatio()
getDevicePixelRatio
in interface IsDefaultOptions
public boolean isDrawOnAttach()
true
if the chart is configured to be drawn on the attach of DIV element, otherwise
false
.isDrawOnAttach
in interface IsDefaultOptions
true
if the chart is configured to be drawn on the attach of DIV element, otherwise
false
. Default is true
.public void setDrawOnAttach(boolean drawOnAttach)
true
if the chart is configured to be draw on the attach of DIV element, otherwise false
.drawOnAttach
- the drawOnAttach to setpublic boolean isDestroyOnDetach()
true
if the chart is configured to be destroyed on the detach from DIV element, otherwise
false
.isDestroyOnDetach
in interface IsDefaultOptions
true
if the chart is configured to be destroyed on the attach of DIV element,
otherwise false
. Default is true
.public void setDestroyOnDetach(boolean destroyOnDetach)
true
if the chart is configured to be destroyed on the detach from DIV element, otherwise
false
.destroyOnDetach
- the destroyOnDetach to setpublic void setDefaultColor(IsColor defaultColor)
defaultColor
- color to use into chart.public void setDefaultColor(String defaultColor)
defaultColor
- color to use into chart.public String getDefaultColorAsString()
getDefaultColorAsString
in interface IsDefaultOptions
public IsColor getDefaultColor()
public void setDefaultFontColor(IsColor defaultFontColor)
defaultFontColor
- font color to use into chart.public void setDefaultFontColor(String defaultFontColor)
defaultFontColor
- font color to use into chart.public String getDefaultFontColorAsString()
getDefaultFontColorAsString
in interface IsDefaultOptions
public IsColor getDefaultFontColor()
public void setDefaultFontSize(int fontSize)
fontSize
- Font size into chart.public int getDefaultFontSize()
getDefaultFontSize
in interface IsDefaultOptions
public void setDefaultFontStyle(FontStyle fontStyle)
fontStyle
- font style to use in the chart, on all objects, if not override by the specific configuration, follows
CSS font-style options (i.e. normal, italic, oblique, initial, inherit).public FontStyle getDefaultFontStyle()
getDefaultFontStyle
in interface IsDefaultOptions
public void setDefaultFontFamily(String fontFamily)
fontFamily
- Font family to use in the chart, on all objects, if not override by the specific configuration, follows
CSS font-family options.public String getDefaultFontFamily()
getDefaultFontFamily
in interface IsDefaultOptions
public void setDefaultLineHeight(double lineHeight)
lineHeight
- height of an individual line of text.public double getDefaultLineHeight()
getDefaultLineHeight
in interface IsDefaultOptions
public void setShowLines(boolean showLine)
false
, the lines between points are not drawn.showLine
- if false
, the lines between points are not drawn.public boolean isShowLines()
false
, the lines between points are not drawn.isShowLines
in interface IsDefaultOptions
false
, the lines between points are not drawn..public void setSpanGaps(boolean spanGaps)
false
, NaN
data causes a break in the line.spanGaps
- if false
, NaN
data causes a break in the line.public boolean isSpanGaps()
false
, NaN
data causes a break in the line.isSpanGaps
in interface IsDefaultOptions
false
, NaN
data causes a break in the line.public void setCutoutPercentage(double cutoutPercentage)
cutoutPercentage
- the percentage of the chart that is cut out of the middle.public double getCutoutPercentage()
getCutoutPercentage
in interface IsDefaultOptions
public void setRotation(double rotation)
rotation
- starting angle to draw arcs from.public double getRotation()
getRotation
in interface IsDefaultOptions
public void setCircumference(double circumference)
circumference
- the sweep to allow arcs to cover.public double getCircumference()
getCircumference
in interface IsDefaultOptions
public void setStartAngle(double startAngle)
startAngle
- starting angle to draw arcs for the first item in a dataset.public double getStartAngle()
getStartAngle
in interface IsDefaultOptions
protected final Key getChildKey()
null
if is a root element.protected final P getParent()
null
if is a root element.protected final D getDefaultValues()
protected final void setEventToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model, Key key, CallbackProxy.Proxy proxy)
model
- element where adding the function proxykey
- property name to use to add the function proxyproxy
- the function proxy instance to addprotected final void setCallbackToModel(org.pepstock.charba.client.options.AbstractModel<?,?> model, Key key, CallbackProxy.Proxy proxy)
model
- element where adding the function proxykey
- property name to use to add the function proxyproxy
- the function proxy instance to addprotected final void checkAndAddToParent()