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.
|
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 |
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 |
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 |
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, getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, 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, typeprotected 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 IsDefaultOptionspublic Legend getLegend()
getLegend in interface IsDefaultOptionspublic final Hover getHover()
getHover in interface IsDefaultOptionspublic final Layout getLayout()
getLayout in interface IsDefaultOptionspublic final Elements getElements()
getElements in interface IsDefaultOptionspublic final Title getTitle()
getTitle in interface IsDefaultOptionspublic final Tooltips getTooltips()
getTooltips in interface IsDefaultOptionspublic final Plugins getPlugins()
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 IsDefaultOptionspublic 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 IsDefaultOptionspublic void setMaintainAspectRatio(boolean maintainAspectRatio)
maintainAspectRatio - the maintaining of the original canvas aspect ratio (width / height) when resizing.public boolean isMaintainAspectRatio()
isMaintainAspectRatio in interface IsDefaultOptionspublic void setAspectRatio(double ratio)
ratio - the aspect ratio.public double getAspectRatio()
getAspectRatio in interface IsDefaultOptionspublic void setDevicePixelRatio(double ratio)
ratio - the pixel ratio.public double getDevicePixelRatio()
getDevicePixelRatio in interface IsDefaultOptionspublic 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 IsDefaultOptionspublic 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 IsDefaultOptionspublic IsColor getDefaultFontColor()
public void setDefaultFontSize(int fontSize)
fontSize - Font size into chart.public int getDefaultFontSize()
getDefaultFontSize in interface IsDefaultOptionspublic 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 IsDefaultOptionspublic 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 IsDefaultOptionspublic 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 IsDefaultOptionsfalse, 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 IsDefaultOptionsfalse, 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 IsDefaultOptionspublic void setRotation(double rotation)
rotation - starting angle to draw arcs from.public double getRotation()
getRotation in interface IsDefaultOptionspublic void setCircumference(double circumference)
circumference - the sweep to allow arcs to cover.public double getCircumference()
getCircumference in interface IsDefaultOptionspublic void setStartAngle(double startAngle)
startAngle - starting angle to draw arcs for the first item in a dataset.public double getStartAngle()
getStartAngle in interface IsDefaultOptionsprotected 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()