Class Options<T extends Options<T,A>,A extends Animation<A>>
java.lang.Object
software.xdev.chartjs.model.options.Options<T,A>
- Direct Known Subclasses:
BarOptions
,BubbleOptions
,DoughnutOptions
,LineOptions
,PieOptions
,PolarOptions
,RadarOptions
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Boolean
protected Animations<A>
protected Hover
protected IndexAxis
protected Layout
protected JavaScriptFunction
protected Boolean
protected JavaScriptFunction
protected JavaScriptFunction
protected Plugins
protected Boolean
protected Integer
protected Scales
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHover()
protected T
self()
setAnimation
(Boolean animation) Defaulttrue
Disables the Animation completely if set tofalse
.setAnimations
(Animations<A> animations) The following animation options are available.setEvents
(Collection<String> events) Default["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]
Events that the chart should listen to for tooltips and hoveringThe hover configuration is passed into the options.hover namespace.setIndexAxis
(IndexAxis indexAxis) setLegendCallback
(JavaScriptFunction legendCallback) Defaultfunction (chart) { }
Function to generate a legend.setMaintainAspectRatio
(Boolean maintainAspectRatio) Defaulttrue
Maintain the original canvas aspect ratio (width / height) when resizingsetOnClick
(JavaScriptFunction onClick) Defaultnull
Called if the event is of type 'mouseup' or 'click'.setOnResize
(JavaScriptFunction onResize) Defaultnull
Called when a resize occurs.setPlugins
(Plugins plugins) A placeholder in which configuration options for plugins may be passed.setResponsive
(Boolean responsive) Defaulttrue
Resizes when the canvas container does.setResponsiveAnimationDuration
(Integer responsiveAnimationDuration) Default0
Duration in milliseconds it takes to animate to new size after a resize event.
-
Field Details
-
events
-
indexAxis
-
responsive
-
responsiveAnimationDuration
-
maintainAspectRatio
-
onClick
-
legendCallback
-
onResize
-
hover
-
animations
-
animation
-
layout
-
plugins
-
scales
-
-
Constructor Details
-
Options
public Options()
-
-
Method Details
-
getScales
-
setScales
-
getIndexAxis
-
setIndexAxis
-
getResponsive
- See Also:
-
setResponsive
Defaulttrue
Resizes when the canvas container does. -
getAnimation
- See Also:
-
setAnimation
Defaulttrue
Disables the Animation completely if set tofalse
. -
getResponsiveAnimationDuration
- See Also:
-
setResponsiveAnimationDuration
Default0
Duration in milliseconds it takes to animate to new size after a resize event. -
getMaintainAspectRatio
- See Also:
-
setMaintainAspectRatio
Defaulttrue
Maintain the original canvas aspect ratio (width / height) when resizing -
getEvents
- See Also:
-
setEvents
Default["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]
Events that the chart should listen to for tooltips and hovering -
getOnClick
- See Also:
-
setOnClick
Defaultnull
Called if the event is of type 'mouseup' or 'click'. Called in the context of the chart and passed an array of active arcElements -
getLegendCallback
- See Also:
-
setLegendCallback
Defaultfunction (chart) { }
Function to generate a legend. Receives the chart object to generate a legend from. Default implementation returns an HTML string. -
getOnResize
- See Also:
-
setOnResize
Defaultnull
Called when a resize occurs. Gets passed two arguemnts: the chart instance and the new size. -
getHover
- See Also:
-
setHover
The hover configuration is passed into the options.hover namespace. The global hover configuration is at Chart.defaults.global.hover. -
getAnimations
- See Also:
-
setAnimations
The following animation options are available. The global options for are defined in Chart.defaults.global.animation. -
getLayout
- Returns:
Layout
instance ornull
-
setLayout
- Parameters:
layout
-Layout
instance ornull
- Returns:
this
instance for chaining
-
getPlugins
- See Also:
-
setPlugins
A placeholder in which configuration options for plugins may be passed.- Parameters:
plugins
-Object
ornull
- Returns:
this
instance for chaining
-
self
-