Class DefaultGlobalOptions
- java.lang.Object
-
- org.pepstock.charba.client.defaults.globals.AbstractDefaultOptions
-
- org.pepstock.charba.client.defaults.chart.DefaultGlobalOptions
-
- All Implemented Interfaces:
IsDefaultAnimationContainer
,IsDefaultAnimationTransition
,IsDefaultEventHandler
,IsDefaultOptions
,IsDefaultScaledOptions
public final class DefaultGlobalOptions extends AbstractDefaultOptions implements IsDefaultScaledOptions
Defaults for options element, using the defualt global options.
THIS IS THE ROOT OF ALL ELEMENTS DEFAULTS.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description DefaultGlobalOptions(GlobalOptions globalOptions)
Creates the object by global options and defaults scaled options
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAspectRatio()
Canvas aspect ratio (i.e.String
getBackgroundColorAsString()
Returns the default background color to use in the chart, on all objects, if not override by the specific configuration.String
getBorderColorAsString()
Returns the default border color to use in the chart, on all objects, if not override by the specific configuration.double
getCircumference()
Returns the sweep to allow arcs to cover.String
getColorAsString()
Returns the default color to use in the chart, on all objects, if not override by the specific configuration.double
getCutout()
Returns the portion of the chart that is cut out of the middle.
AsDouble
, it is considered to be pixels.String
getCutoutPercentage()
Returns the portion of the chart that is cut out of the middle.
AsString
and ending with '%', percentage of the chart radius.double
getDevicePixelRatio()
The chart's canvas will use a 1:1 pixel ratio, unless the physical display has a higher pixel ratio (e.g.Set<Event>
getEvents()
Returns the browser events that the chart should listen to.IndexAxis
getIndexAxis()
Returns the base axis for the dataset, only for bar options.CLocale
getLocale()
Returns the locale instance for internationalization.double
getRadius()
Returns the outer radius of the chart.
AsDouble
, it is considered to be pixels.String
getRadiusPercentage()
Returns the outer radius of the chart.
AsString
and ending with '%', percentage of the maximum radius.double
getResizeDelay()
Returns the delay the resize update by give amount of milliseconds.
This can ease the resize process by debouncing update of the elements.double
getRotation()
Returns the starting angle to draw arcs from.IsDefaultScales
getScales()
Returns the scale/axis defaults.boolean
isDestroyOnDetach()
Returnstrue
if the chart is configured to be destroyed on the attach of DIV element, otherwisefalse
.boolean
isDrawOnAttach()
Returnstrue
if the chart is configured to be drawn on the attach of DIV element, otherwisefalse
.boolean
isMaintainAspectRatio()
Returns 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
isShowLine()
If false, the lines between points are not drawn.boolean
isSkipNull()
If true, null or undefined values will not be drawn.boolean
isSpanGaps()
If false,Double.NaN
data causes a break in the line.-
Methods inherited from class org.pepstock.charba.client.defaults.globals.AbstractDefaultOptions
getAnimation, getAnimations, getDatasets, getDecimation, getElements, getFiller, getFont, getHover, getInteraction, getLayout, getLegend, getPlugins, getSubtitle, getTitle, getTooltips, getTransitions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultAnimationContainer
getTransitions
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultAnimationTransition
getAnimation, getAnimations
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultEventHandler
getEvents
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultOptions
getAspectRatio, getBackgroundColorAsString, getBorderColorAsString, getCircumference, getColorAsString, getCutout, getCutoutPercentage, getDatasets, getDecimation, getDevicePixelRatio, getElements, getFiller, getFont, getHover, getIndexAxis, getInteraction, getLayout, getLegend, getLocale, getPlugins, getRadius, getRadiusPercentage, getResizeDelay, getRotation, getSubtitle, getTitle, getTooltips, isDestroyOnDetach, isDrawOnAttach, isMaintainAspectRatio, isResponsive, isShowLine, isSkipNull, isSpanGaps
-
-
-
-
Constructor Detail
-
DefaultGlobalOptions
public DefaultGlobalOptions(GlobalOptions globalOptions)
Creates the object by global options and defaults scaled options- Parameters:
globalOptions
- global options instance used as default.
-
-
Method Detail
-
getScales
public IsDefaultScales getScales()
Description copied from interface:IsDefaultScaledOptions
Returns the scale/axis defaults.- Specified by:
getScales
in interfaceIsDefaultScaledOptions
- Returns:
- the scale/axis defaults.
-
getEvents
public Set<Event> getEvents()
Description copied from interface:IsDefaultEventHandler
Returns the browser events that the chart should listen to.- Returns:
- the browser events that the chart should listen to.
-
getLocale
public CLocale getLocale()
Description copied from interface:IsDefaultOptions
Returns the locale instance for internationalization.- Returns:
- the locale instance
-
isResponsive
public final boolean isResponsive()
Description copied from interface:IsDefaultOptions
Returns the resizing of the chart canvas when its container does.- Returns:
- the resizing of the chart canvas when its container does.
-
isMaintainAspectRatio
public final boolean isMaintainAspectRatio()
Description copied from interface:IsDefaultOptions
Returns the maintaining of the original canvas aspect ratio (width / height) when resizing.- Returns:
- the maintaining of the original canvas aspect ratio (width / height) when resizing.
-
getAspectRatio
public final double getAspectRatio()
Description copied from interface:IsDefaultOptions
Canvas aspect ratio (i.e. width / height, a value of 1 representing a square canvas).
Note that this option is ignored if the height is explicitly defined either as attribute or via the style.- Returns:
- the aspect ratio.
-
getResizeDelay
public double getResizeDelay()
Description copied from interface:IsDefaultOptions
Returns the delay the resize update by give amount of milliseconds.
This can ease the resize process by debouncing update of the elements.- Returns:
- the delay the resize update by give amount of milliseconds
-
getDevicePixelRatio
public final double getDevicePixelRatio()
Description copied from interface:IsDefaultOptions
The chart's canvas will use a 1:1 pixel ratio, unless the physical display has a higher pixel ratio (e.g. Retina displays). Setting devicePixelRatio to a value other than 1 will force the canvas size to be scaled by that amount. Returns the pixel ratio.- Returns:
- the pixel ratio.
-
getColorAsString
public final String getColorAsString()
Description copied from interface:IsDefaultOptions
Returns the default color to use in the chart, on all objects, if not override by the specific configuration.- Returns:
- color to use in the chart.
-
getBackgroundColorAsString
public String getBackgroundColorAsString()
Description copied from interface:IsDefaultOptions
Returns the default background color to use in the chart, on all objects, if not override by the specific configuration.- Returns:
- background color to use in the chart.
-
getBorderColorAsString
public String getBorderColorAsString()
Description copied from interface:IsDefaultOptions
Returns the default border color to use in the chart, on all objects, if not override by the specific configuration.- Returns:
- border color to use in the chart.
-
isShowLine
public final boolean isShowLine()
Description copied from interface:IsDefaultOptions
If false, the lines between points are not drawn.- Returns:
- If false, the lines between points are not drawn.
-
isSpanGaps
public final boolean isSpanGaps()
Description copied from interface:IsDefaultOptions
If false,Double.NaN
data causes a break in the line.- Returns:
- If false,
Double.NaN
data causes a break in the line.
-
getCutout
public double getCutout()
Description copied from interface:IsDefaultOptions
Returns the portion of the chart that is cut out of the middle.
AsDouble
, it is considered to be pixels.- Returns:
- the portion of the chart that is cut out of the middle.
AsDouble
, it is considered to be pixels.
-
getCutoutPercentage
public String getCutoutPercentage()
Description copied from interface:IsDefaultOptions
Returns the portion of the chart that is cut out of the middle.
AsString
and ending with '%', percentage of the chart radius.- Returns:
- the portion of the chart that is cut out of the middle.
AsString
and ending with '%', percentage of the chart radius.
-
getRadius
public double getRadius()
Description copied from interface:IsDefaultOptions
Returns the outer radius of the chart.
AsDouble
, it is considered to be pixels.- Returns:
- the outer radius of the chart.
AsDouble
, it is considered to be pixels.
-
getRadiusPercentage
public String getRadiusPercentage()
Description copied from interface:IsDefaultOptions
Returns the outer radius of the chart.
AsString
and ending with '%', percentage of the maximum radius.- Returns:
- the outer radius of the chart.
AsString
and ending with '%', percentage of the maximum radius.
-
getRotation
public final double getRotation()
Description copied from interface:IsDefaultOptions
Returns the starting angle to draw arcs from.- Returns:
- starting angle to draw arcs from.
-
getCircumference
public final double getCircumference()
Description copied from interface:IsDefaultOptions
Returns the sweep to allow arcs to cover.- Returns:
- the sweep to allow arcs to cover.
-
isDrawOnAttach
public final boolean isDrawOnAttach()
Description copied from interface:IsDefaultOptions
Returnstrue
if the chart is configured to be drawn on the attach of DIV element, otherwisefalse
.- Returns:
- the drawOnAttach
true
if the chart is configured to be drawn on the attach of DIV element, otherwisefalse
.
-
isDestroyOnDetach
public final boolean isDestroyOnDetach()
Description copied from interface:IsDefaultOptions
Returnstrue
if the chart is configured to be destroyed on the attach of DIV element, otherwisefalse
.- Returns:
- the destroyOnDetach
true
if the chart is configured to be destroyed on the attach of DIV element, otherwisefalse
.
-
isSkipNull
public final boolean isSkipNull()
Description copied from interface:IsDefaultOptions
If true, null or undefined values will not be drawn.- Returns:
- If true, null or undefined values will not be drawn.
-
getIndexAxis
public final IndexAxis getIndexAxis()
Description copied from interface:IsDefaultOptions
Returns the base axis for the dataset, only for bar options.- Returns:
- the base axis for the dataset, only for bar options
-
-