public abstract class Chart extends com.google.gwt.user.client.ui.SimplePanel implements HasAnimationCompleteHandlers, com.google.gwt.event.dom.client.HasClickHandlers, HasAnimation, HasDataSelectionEventHandlers, IsResponsive
Modifier and Type | Field and Description |
---|---|
protected List<AnimationCallback> |
callbackList |
protected com.google.gwt.core.client.JavaScriptObject |
nativeCanvas |
protected LegendOption |
options |
protected ChartStyle |
style |
ANIMATION, ANIMATION_EASING, ANIMATION_STEPS
MAINTAIN_ASPECT_RATIO, RESPONSIVE
Constructor and Description |
---|
Chart()
Constructor creates chart with default style
|
Chart(ChartStyle style)
This constructor creates new chart instance with custom
ChartStyle |
Modifier and Type | Method and Description |
---|---|
void |
addAnimationCallback(AnimationCallback callback)
Add animation callback to handle animation state changes
|
void |
addAnimationCompleteHandler(AnimationCompleteHandler handler)
Add
AnimationCompleteEvent handler to widget. |
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler clickHandler) |
com.google.gwt.event.shared.HandlerRegistration |
addDataSelectionHandler(DataSelectionHandler handler)
Add
AnimationCompleteEvent handler to widget. |
protected com.google.gwt.core.client.JavaScriptObject |
constructOptions()
Method returns custom options for chart
|
protected abstract void |
draw()
Method preparing data and invoking native draw method
This method should not be overridden by sub-classes |
protected com.google.gwt.core.client.JavaScriptObject |
getNativeCanvas() |
protected com.google.gwt.dom.client.CanvasElement |
getNativeElement() |
com.google.gwt.user.client.ui.Image |
getSnapshot()
Creates snapshot of current state of chart as image
|
protected void |
onAnimationComplete() |
protected void |
onAnimationProgress(double progress) |
protected void |
onAttach() |
protected void |
processEvents(com.google.gwt.core.client.JavaScriptObject object) |
protected void |
registerNativeAnimationHandlers() |
abstract void |
reload()
Method requesting data from data provider and re-drawing chart.
|
void |
setAnimationEnabled(boolean enabled)
Specify should chart be animated or not
Default value is
true |
void |
setAnimationSteps(int steps)
Particularly specify quality of animation
Default value is 60
|
void |
setAnimationType(Type type)
Specify animation easing
Default value is
Type.EASE_OUT_QUART |
void |
setChartStyle(ChartStyle style)
Set new style to the char widget.
|
void |
setHeight(String height) |
void |
setLegendTemplate(String template) |
void |
setMaintainAspectRatio(boolean aspectRatio) |
protected void |
setNativeCanvas(com.google.gwt.core.client.JavaScriptObject object) |
void |
setPixelHeight(int height)
Method sets pixel height of chart area
|
void |
setPixelWidth(int width)
Method sets pixel width of chart area
|
void |
setResponsive(boolean responsive) |
void |
setWidth(String width) |
abstract void |
update()
Method re-drawing chart widget without re-requesting data from data provider.
|
add, getContainerElement, getWidget, iterator, remove, setWidget, setWidget
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected LegendOption options
protected com.google.gwt.core.client.JavaScriptObject nativeCanvas
protected ChartStyle style
protected List<AnimationCallback> callbackList
public Chart(ChartStyle style)
ChartStyle
style
- - new CssResource used for styling chartspublic Chart()
public void setChartStyle(ChartStyle style)
style
- protected void processEvents(com.google.gwt.core.client.JavaScriptObject object)
protected void onAttach()
onAttach
in class com.google.gwt.user.client.ui.Widget
public abstract void update()
reload()
method insteadpublic abstract void reload()
protected abstract void draw()
public void setPixelWidth(int width)
width
- - width in pixels
TODO: replace it with generic setWidth(String)
and UIObject.setSize(String, String)
public void setWidth(String width)
setWidth
in class com.google.gwt.user.client.ui.UIObject
public void setHeight(String height)
setHeight
in class com.google.gwt.user.client.ui.UIObject
public void setPixelHeight(int height)
height
- - height in pixels
TODO: replace it with generic setHeight(String)
and UIObject.setSize(String, String)
public void addAnimationCompleteHandler(AnimationCompleteHandler handler)
HasAnimationCompleteHandlers
AnimationCompleteEvent
handler to widget.addAnimationCompleteHandler
in interface HasAnimationCompleteHandlers
public com.google.gwt.user.client.ui.Image getSnapshot()
public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler clickHandler)
addClickHandler
in interface com.google.gwt.event.dom.client.HasClickHandlers
public com.google.gwt.event.shared.HandlerRegistration addDataSelectionHandler(DataSelectionHandler handler)
HasDataSelectionEventHandlers
AnimationCompleteEvent
handler to widget.addDataSelectionHandler
in interface HasDataSelectionEventHandlers
protected com.google.gwt.core.client.JavaScriptObject getNativeCanvas()
protected com.google.gwt.dom.client.CanvasElement getNativeElement()
protected void setNativeCanvas(com.google.gwt.core.client.JavaScriptObject object)
public void setAnimationEnabled(boolean enabled)
true
setAnimationEnabled
in interface HasAnimation
enabled
- public void setAnimationType(Type type)
Type.EASE_OUT_QUART
setAnimationType
in interface HasAnimation
type
- public void addAnimationCallback(AnimationCallback callback)
addAnimationCallback
in interface HasAnimation
callback
- public void setAnimationSteps(int steps)
HasAnimation
setAnimationSteps
in interface HasAnimation
protected com.google.gwt.core.client.JavaScriptObject constructOptions()
protected void registerNativeAnimationHandlers()
protected void onAnimationProgress(double progress)
protected void onAnimationComplete()
public void setResponsive(boolean responsive)
setResponsive
in interface IsResponsive
public void setMaintainAspectRatio(boolean aspectRatio)
setMaintainAspectRatio
in interface IsResponsive
public void setLegendTemplate(String template)
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.