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_STEPSMAINTAIN_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, setWidgetadd, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected LegendOption options
protected com.google.gwt.core.client.JavaScriptObject nativeCanvas
protected ChartStyle style
protected List<AnimationCallback> callbackList
public Chart(ChartStyle style)
ChartStylestyle - - 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.Widgetpublic 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.UIObjectpublic void setHeight(String height)
setHeight in class com.google.gwt.user.client.ui.UIObjectpublic 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)
HasAnimationCompleteHandlersAnimationCompleteEvent handler to widget.addAnimationCompleteHandler in interface HasAnimationCompleteHandlerspublic 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.HasClickHandlerspublic com.google.gwt.event.shared.HandlerRegistration addDataSelectionHandler(DataSelectionHandler handler)
HasDataSelectionEventHandlersAnimationCompleteEvent handler to widget.addDataSelectionHandler in interface HasDataSelectionEventHandlersprotected 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)
truesetAnimationEnabled in interface HasAnimationenabled - public void setAnimationType(Type type)
Type.EASE_OUT_QUARTsetAnimationType in interface HasAnimationtype - public void addAnimationCallback(AnimationCallback callback)
addAnimationCallback in interface HasAnimationcallback - public void setAnimationSteps(int steps)
HasAnimationsetAnimationSteps in interface HasAnimationprotected 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 IsResponsivepublic void setMaintainAspectRatio(boolean aspectRatio)
setMaintainAspectRatio in interface IsResponsivepublic void setLegendTemplate(String template)
Copyright © 2012–2018 JBoss by Red Hat. All rights reserved.