D - Dataset type for the specific chartpublic abstract class AbstractChart<D extends Dataset> extends HandlerManager implements IsChart
| Constructor and Description | 
|---|
| AbstractChart(Type type)Initializes simple panel and canvas which are used by CHART.JS. It sets also some default behaviors (width in percentage) for resizing | 
| Modifier and Type | Method and Description | 
|---|---|
| HandlerRegistration | addHandler(EventHandler handler,
          EventType type)Adds a event handler. | 
| void | clear()Will clear the chart canvas. Used extensively internally between animation frames. Overrides the clearmethod of GWTPanel, changing completely the behavior of GWTPanelone. | 
| protected ChartOptions | createChartOptions()Creates the chart options based on type of chart. It can be override when a controller is implemented. | 
| void | destroy()Use this to destroy any chart instances that are created. | 
| void | draw()Draws the chart | 
| String | generateLegend()Returns an HTML string of a legend for that chart. | 
| Type | getBaseType()Returns the base type of chart that in case of  ChartTypeis the same ofIsChart.getType()otherwise, in case the type of the chart is aControllerTypeis the chart type extension if there is ornull. | 
| Canvas | getCanvas()Returns the canvas element used to draw the chart. | 
| Div | getChartElement()Gets a handle to the object's underlying DOM element. | 
| Data | getData()Returns the data object with all passed datasets. | 
| DatasetMetaItem | getDatasetAtEvent(BaseNativeEvent event)Looks for the dataset that matches the event and returns that metadata. | 
| DatasetMetaItem | getDatasetMeta(int index)Looks for the dataset that matches the current index and returns that metadata. | 
| IsDefaultScaledOptions | getDefaultChartOptions()Returns the default options created based on chart type. | 
| DatasetItem | getElementAtEvent(BaseNativeEvent 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. | 
| List<DatasetItem> | getElementsAtEvent(BaseNativeEvent 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. | 
| String | getId()Returns the ID of chart. It could be considered as chart unique ID. | 
| CursorType | getInitialCursor()Returns the initial cursor of the chart. | 
| ChartNode | getNode()Returns the chart node with runtime data. | 
| Plugins | getPlugins()Returns the plugins element to manage inline plugins. | 
| protected IsChart | getSource()Returns a chart instance as source for all events. | 
| Type | getType()Returns the type of chart. | 
| int | getVisibleDatasetCount()Returns the amount of datasets which are visible | 
| IsDefaultScaledOptions | getWholeOptions()Returns the default options by a chart instance, merging global, chart type global and chart options. If the options is not consistent, it will returns the getDefaultChartOptions(). | 
| boolean | isDatasetVisible(int index)Looks for the dataset if it's visible or not, selected by index. | 
| boolean | isDestroyOnDetach()Returns  trueif the chart is configured to be destroyed on the detach from DIV element, otherwisefalse. | 
| boolean | isDrawOnAttach()Returns  trueif the chart is configured to be drawn on the attach of DIV element, otherwisefalse. | 
| boolean | isInitialized()Returns  trueif CHART.JS chart has been initialized, otherwisefalse. | 
| abstract D | newDataset()Creates a new dataset related to chart type. | 
| void | onAttach(MutationItem item)Invoked by mutation observer when a chart has been attached into the DOM tree. | 
| void | onDetach(MutationItem item)Invoked by mutation observer when a chart has been detached from the DOM tree. | 
| void | reconfigure()Triggers an update of the chart. | 
| void | reconfigure(UpdateConfiguration configuration)Triggers an update of the chart. | 
| void | removeCanvasPreventDefault()Remove the registration of prevent default mouse listener from canvas. This is necessary when you will add your mouse down listener. | 
| void | render()Triggers a redraw of all chart elements. | 
| void | render(UpdateConfiguration configuration)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)Sets  trueif the chart is configured to be destroyed on the detach from DIV element, otherwisefalse. | 
| void | setDrawOnAttach(boolean drawOnAttach)Sets  trueif the chart is configured to be draw on the attach of DIV element, otherwisefalse. | 
| void | stop()Use this to stop any current animation loop. This will pause the chart during any current animation frame. Call .render()to re-animate. | 
| String | toBase64Image()Returns a base 64 encoded string of the chart in it's current state. | 
| void | update()Triggers an update of the chart. | 
| void | update(UpdateConfiguration configuration)Triggers an update of the chart. | 
fireEvent, getHandlerCount, isEventHandledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckAndGetIfConsistent, checkIfConsistent, checkIfValid, fireEvent, getOptions, isAbstractChart, isConsistent, isValidpublic AbstractChart(Type type)
type - the type of chartprotected final IsChart getSource()
HandlerManagergetSource in class HandlerManagerpublic final HandlerRegistration addHandler(EventHandler handler, EventType type)
HandlerManageraddHandler in interface IsChartaddHandler in class HandlerManagerhandler - handler instance to addtype - the event type associated with handlerpublic final Div getChartElement()
IsChartgetChartElement in interface IsChartpublic final Type getType()
IsChartpublic abstract D newDataset()
public final String getId()
public final Type getBaseType()
IsChartChartType is the same of IsChart.getType() otherwise, in case the type of the chart is a
 ControllerType is the chart type extension if there is or null.getBaseType in interface IsChartpublic final Canvas getCanvas()
public final void removeCanvasPreventDefault()
removeCanvasPreventDefault in interface IsChartpublic final CursorType getInitialCursor()
getInitialCursor in interface IsChartpublic final boolean isInitialized()
true if CHART.JS chart has been initialized, otherwise false.isInitialized in interface IsCharttrue if CHART.JS chart has been initialized, otherwise false.public final ChartNode getNode()
public final Data getData()
public final Plugins getPlugins()
getPlugins in interface IsChartprotected ChartOptions createChartOptions()
public final IsDefaultScaledOptions getDefaultChartOptions()
getDefaultChartOptions in interface IsChartpublic final IsDefaultScaledOptions getWholeOptions()
getDefaultChartOptions().getWholeOptions in interface IsChartpublic final boolean isDrawOnAttach()
true if the chart is configured to be drawn on the attach of DIV element, otherwise false.isDrawOnAttach in interface IsCharttrue if the chart is configured to be drawn on the attach of DIV element, otherwise false. Default is true.public final void setDrawOnAttach(boolean drawOnAttach)
true if the chart is configured to be draw on the attach of DIV element, otherwise false.setDrawOnAttach in interface IsChartdrawOnAttach - the drawOnAttach to setpublic final boolean isDestroyOnDetach()
true if the chart is configured to be destroyed on the detach from DIV element, otherwise false.isDestroyOnDetach in interface IsCharttrue if the chart is configured to be destroyed on the detach from DIV element, otherwise false. Default is
         true.public final void setDestroyOnDetach(boolean destroyOnDetach)
true if the chart is configured to be destroyed on the detach from DIV element, otherwise false.setDestroyOnDetach in interface IsChartdestroyOnDetach - the destroyOnDetach to setpublic final void onAttach(MutationItem item)
item - can not be instantiated out of this package to avoid that anyone (apart the observer) will invoke the method.public final void onDetach(MutationItem item)
item - can not be instantiated out of this package to avoid that anyone (apart the observer) will invoke the method.public final void destroy()
public final void stop()
.render() to re-animate.public final void clear()
clear method of GWT Panel, changing completely the behavior of GWT Panel one.public final void reset()
public final String toBase64Image()
toBase64Image in interface IsChartUndefinedValues.STRING if chart is not initialized.public final String generateLegend()
generateLegend in interface IsChartUndefinedValues.STRING if chart is not initialized.public final void resize()
public final void update()
public final void update(UpdateConfiguration configuration)
public final void reconfigure()
reconfigure in interface IsChartpublic final void reconfigure(UpdateConfiguration configuration)
reconfigure in interface IsChartconfiguration - a configuration object can be provided with additional configuration for the update processpublic final void render()
.update() in that case.public final void render(UpdateConfiguration configuration)
.update() in that case. A configuration 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.public final DatasetMetaItem getDatasetMeta(int index)
getDatasetMeta in interface IsChartindex - dataset indexnull if the index is out of range of datasets count.public final DatasetMetaItem getDatasetAtEvent(BaseNativeEvent event)
getDatasetAtEvent in interface IsChartevent - event of chart.null if event is not consistentpublic final boolean isDatasetVisible(int index)
isDatasetVisible in interface IsChartindex - dataset indextrue if dataset is visible otherwise false.public final int getVisibleDatasetCount()
getVisibleDatasetCount in interface IsChartUndefinedValues.INTEGER.public final DatasetItem getElementAtEvent(BaseNativeEvent event)
getElementAtEvent in interface IsChartevent - event of chart.null if event is not consistentpublic final List<DatasetItem> getElementsAtEvent(BaseNativeEvent event)
getElementsAtEvent in interface IsChartevent - event of chart.