public abstract class ConfigurationOptions extends Object implements ConfigurationElement
charbaId
property key.Modifier and Type | Method and Description |
---|---|
Animation |
getAnimation()
Returns the animation element.
|
double |
getAspectRatio()
Canvas aspect ratio (i.e.
|
IsChart |
getChart()
Returns the chart instance
|
protected T |
getConfiguration()
Returns the configuration element.
|
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.
|
LegendCallback |
getLegendCallback()
Returns the legend callback instance
|
Plugins |
getPlugins()
Returns the plugins element.
|
int |
getResponsiveAnimationDuration()
Returns the duration in milliseconds it takes to animate to new size after a resize event.
|
Title |
getTitle()
Returns the title element.
|
Tooltips |
getTooltips()
Returns the tooltips element.
|
boolean |
hasAxisClickHandlers()
Returns
true if there is any axis click handler, otherwise false . |
boolean |
hasDatasetSelectionHandlers()
Returns
true if there is any dataset selection handler, otherwise false . |
boolean |
hasTitleClickHandlers()
Returns
true if there is any title click handler, otherwise false . |
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.
|
void |
load(IsChart chart,
Configuration configuration)
Called to enable to load into a configuration object the specific configuration item (by native object).
|
void |
loadOptions(OptionsEnvelop envelop)
Merges chart default options (by chart.defaults[type]), default scale options (by chart.defaults.scale) and global
options (by chart.defaults.global) and chart options.
The chain of priority is: chart options chart default options (by chart.defaults[type]) default scale options (by chart.defaults.scale) global options (by chart.defaults.global) |
void |
merge(NativeObjectContainer source,
String property)
Merge a native object into this one with a specific property name.
This is used by plugins implementation (native java script ones) when they are not using the standard way to add plugin configuration into options of chart. |
void |
onAdd(AddHandlerEvent event)
Invoked when a new event handler is added.
|
void |
onRemove(RemoveHandlerEvent event)
Invoked when a chart event handler is removed.
|
static void |
register(IsChart chart,
org.pepstock.charba.client.configuration.IsEventProvider provider)
Adds the event provider implementation as handlers of chart.
|
void |
setAspectRatio(double ratio)
Canvas aspect ratio (i.e.
|
protected void |
setConfiguration(T configuration) |
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.
|
void |
setLegendCallback(LegendCallback legendCallback)
Sets the legend callback instance
|
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.
|
String |
toJSON()
Returns the JSON representation of the object.
|
public final void loadOptions(OptionsEnvelop envelop)
envelop
- the envelop for options as native optionspublic Animation getAnimation()
public Hover getHover()
public Layout getLayout()
public Legend getLegend()
public Title getTitle()
public Tooltips getTooltips()
public Elements getElements()
public Plugins getPlugins()
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()
public void setResponsiveAnimationDuration(int milliseconds)
milliseconds
- the duration in milliseconds it takes to animate to new size after a resize event.public int getResponsiveAnimationDuration()
public void setMaintainAspectRatio(boolean maintainAspectRatio)
maintainAspectRatio
- the maintaining of the original canvas aspect ratio (width / height) when resizing.public boolean isMaintainAspectRatio()
public void setAspectRatio(double ratio)
ratio
- the aspect ratio.public double getAspectRatio()
public void setDevicePixelRatio(double ratio)
ratio
- the pixel ratio.public double getDevicePixelRatio()
public boolean isDrawOnAttach()
true
if the chart is configured to be drawn on the attach of DIV element, otherwise
false
.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
.true
if the chart is configured to be destroyed on the detach from 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 final boolean hasDatasetSelectionHandlers()
true
if there is any dataset selection handler, otherwise false
.true
if there is any dataset selection handler, otherwise false
.public final boolean hasTitleClickHandlers()
true
if there is any title click handler, otherwise false
.true
if there is any title click handler, otherwise false
.public final boolean hasAxisClickHandlers()
true
if there is any axis click handler, otherwise false
.true
if there is any axis click handler, otherwise false
.public final void onAdd(AddHandlerEvent event)
AddHandlerEventHandler
event
- event to be consumedpublic final void onRemove(RemoveHandlerEvent event)
RemoveHandlerEventHandler
event
- event to be consumedpublic LegendCallback getLegendCallback()
public void setLegendCallback(LegendCallback legendCallback)
legendCallback
- the legendCallBack to setpublic void load(IsChart chart, Configuration configuration)
ConfigurationElement
load
in interface ConfigurationElement
chart
- chart instanceconfiguration
- chart configuration instancepublic static void register(IsChart chart, org.pepstock.charba.client.configuration.IsEventProvider provider)
chart
- chart instanceprovider
- event provider implmentationprotected final void setConfiguration(T configuration)
configuration
- the configuration to setprotected final T getConfiguration()
public final void merge(NativeObjectContainer source, String property)
source
- native object container to addproperty
- property namepublic final String toJSON()
public final IsChart getChart()