public class Options<T extends Options<T>> extends Object
Constructor and Description |
---|
Options() |
Modifier and Type | Method and Description |
---|---|
Animation<?> |
getAnimation() |
Set<Event> |
getEvents() |
Hover |
getHover() |
Layout |
getLayout() |
Legend |
getLegend() |
JavaScriptFunction |
getLegendCallback() |
Boolean |
getMaintainAspectRatio() |
JavaScriptFunction |
getOnClick() |
JavaScriptFunction |
getOnResize() |
Boolean |
getResponsive() |
Integer |
getResponsiveAnimationDuration() |
Title |
getTitle() |
Tooltips |
getTooltips() |
T |
setAnimation(Animation<?> animation)
The following animation options are available.
|
T |
setEvents(Collection<Event> events)
Default
["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]
Events that the chart should listen to for tooltips and hovering |
T |
setHover(Hover hover)
The hover configuration is passed into the options.hover namespace.
|
T |
setLayout(Layout layout) |
T |
setLegend(Legend legend)
The legend configuration is passed into the options.legend namespace.
|
T |
setLegendCallback(JavaScriptFunction legendCallback)
Default
function (chart) { } Function to generate a legend. |
T |
setMaintainAspectRatio(Boolean maintainAspectRatio)
Default
true Maintain the original canvas aspect ratio (width /
height) when resizing |
T |
setOnClick(JavaScriptFunction onClick)
Default
null Called if the event is of type 'mouseup' or 'click'. |
T |
setOnResize(JavaScriptFunction onResize)
Default
null Called when a resize occurs. |
T |
setResponsive(Boolean responsive)
Default
true Resizes when the canvas container does. |
T |
setResponsiveAnimationDuration(Integer responsiveAnimationDuration)
Default
0 Duration in milliseconds it takes to animate to new
size after a resize event. |
T |
setTitle(Title title)
The title configuration is passed into the options.title namespace.
|
T |
setTooltips(Tooltips tooltips)
The tooltip label configuration is nested below the tooltip configuration
using the callbacks key.
|
public Boolean getResponsive()
setResponsive(Boolean)
public T setResponsive(Boolean responsive)
true
Resizes when the canvas container does.public Integer getResponsiveAnimationDuration()
setResponsiveAnimationDuration(Integer)
public T setResponsiveAnimationDuration(Integer responsiveAnimationDuration)
0
Duration in milliseconds it takes to animate to new
size after a resize event.public Boolean getMaintainAspectRatio()
setMaintainAspectRatio(Boolean)
public T setMaintainAspectRatio(Boolean maintainAspectRatio)
true
Maintain the original canvas aspect ratio (width /
height) when resizingpublic Set<Event> getEvents()
setEvents(Collection)
public T setEvents(Collection<Event> events)
["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]
Events that the chart should listen to for tooltips and hoveringpublic JavaScriptFunction getOnClick()
setOnClick(JavaScriptFunction)
public T setOnClick(JavaScriptFunction onClick)
null
Called if the event is of type 'mouseup' or 'click'.
Called in the context of the chart and passed an array of active
arcElementspublic JavaScriptFunction getLegendCallback()
setLegendCallback(JavaScriptFunction)
public T setLegendCallback(JavaScriptFunction legendCallback)
function (chart) { }
Function to generate a legend.
Receives the chart object to generate a legend from. Default
implementation returns an HTML string.public JavaScriptFunction getOnResize()
setOnResize(JavaScriptFunction)
public T setOnResize(JavaScriptFunction onResize)
null
Called when a resize occurs. Gets passed two
arguemnts: the chart instance and the new size.public Title getTitle()
setTitle(Title)
public T setTitle(Title title)
public Legend getLegend()
setLegend(Legend)
public T setLegend(Legend legend)
public Tooltips getTooltips()
setTooltips(Tooltips)
public T setTooltips(Tooltips tooltips)
public Hover getHover()
setHover(Hover)
public T setHover(Hover hover)
public Animation<?> getAnimation()
setAnimation(Animation)
public T setAnimation(Animation<?> animation)
Copyright © 2017. All rights reserved.