O
- Options type for the specific chartD
- Dataset type for the specific chartpublic abstract class AbstractChart<O extends BaseOptions,D extends Dataset> extends com.google.gwt.user.client.ui.Widget implements IsChart<O,D>
Constructor and Description |
---|
AbstractChart()
Initializes HTMl elements (DIV and Canvas).
It sets also some default behaviors (width in percentage) for resizing |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Will clear the chart canvas.
|
protected com.google.gwt.event.shared.HandlerManager |
createHandlerManager() |
void |
destroy()
Use this to destroy any chart instances that are created.
|
void |
draw() |
java.lang.String |
generateLegend()
Returns an HTML string of a legend for that chart.
|
com.google.gwt.dom.client.CanvasElement |
getCanvas() |
ChartNode |
getChartNode()
Returns the chart node with runtime data.
|
com.google.gwt.dom.client.DivElement |
getContainer() |
Data |
getData() |
DatasetMetaItem |
getDatasetMeta(int index)
Looks for the dataset that matches the current index and returns that metadata.
|
DatasetItem |
getElementAtEvent(ChartNativeEvent event)
Calling on your chart instance passing an argument of an event, will return the single element at the event position.
If there are multiple items within range, only the first is returned. |
DatasetMetaItem |
getElementsAtEvent(ChartNativeEvent event)
Looks for the element under the event point, then returns all elements at the same data index.
Calling it on your chart instance passing an argument of an event, will return the point elements that are at that the same position of that event. |
GlobalOptions |
getGlobal() |
java.lang.String |
getId()
Returns the ID of chart.
It could be considered as chart unique ID. |
Plugins |
getPlugins() |
boolean |
isDestroyOnDetach() |
boolean |
isDrawOnAttach() |
protected void |
onAttach() |
protected void |
onDetach() |
void |
render()
Triggers a redraw of all chart elements.
|
void |
render(UpdateConfiguration config)
Triggers a redraw of all chart elements.
|
void |
reset()
Reset the chart to it's state before the initial animation.
|
void |
resize()
Use this to manually resize the canvas element.
|
void |
setDestroyOnDetach(boolean destroyOnDetach) |
void |
setDrawOnAttach(boolean drawOnAttach) |
void |
setHeight(java.lang.String height) |
void |
setWidth(java.lang.String width) |
void |
stop()
Use this to stop any current animation loop.
|
java.lang.String |
toBase64Image()
his returns a base 64 encoded string of the chart in it's current state.
|
java.lang.String |
toJSONString()
Returns the chart configuration in JSON format.
|
void |
update()
Triggers an update of the chart.
|
void |
update(UpdateConfiguration config)
Triggers an update of the chart.
|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, 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
getOptions, getType, newDataset
public AbstractChart()
protected com.google.gwt.event.shared.HandlerManager createHandlerManager()
createHandlerManager
in class com.google.gwt.user.client.ui.Widget
public final java.lang.String getId()
public final com.google.gwt.dom.client.CanvasElement getCanvas()
public final com.google.gwt.dom.client.DivElement getContainer()
public final ChartNode getChartNode()
public final Data getData()
public final Plugins getPlugins()
public GlobalOptions getGlobal()
public void setHeight(java.lang.String height)
setHeight
in class com.google.gwt.user.client.ui.UIObject
public void setWidth(java.lang.String width)
setWidth
in class com.google.gwt.user.client.ui.UIObject
public boolean isDrawOnAttach()
public void setDrawOnAttach(boolean drawOnAttach)
drawOnAttach
- the drawOnAttach to setpublic boolean isDestroyOnDetach()
public void setDestroyOnDetach(boolean destroyOnDetach)
destroyOnDetach
- the destroyOnDetach to setprotected void onAttach()
onAttach
in class com.google.gwt.user.client.ui.Widget
protected void onDetach()
onDetach
in class com.google.gwt.user.client.ui.Widget
public void destroy()
public void stop()
.render()
to re-animate.render()
public void clear()
public void reset()
public java.lang.String toBase64Image()
public java.lang.String generateLegend()
LegendCallback
public void resize()
public void update()
public void update(UpdateConfiguration config)
config
- A config object can be provided with additional configuration for the update processUpdateConfiguration
public void render()
.update()
in
that case.update()
public void render(UpdateConfiguration config)
.update()
in
that case. A config object can be provided with additional configuration for the render process. This is useful when
update is manually called inside an event handler and some different animation is desired.config
- A config object can be provided with additional configuration for the render processupdate()
,
UpdateConfiguration
public DatasetMetaItem getDatasetMeta(int index)
index
- dataset indexpublic DatasetItem getElementAtEvent(ChartNativeEvent event)
event
- event of chart.public DatasetMetaItem getElementsAtEvent(ChartNativeEvent event)
event
- event of chart.public void draw()
public java.lang.String toJSONString()