com.sencha.gxt.chart.client.chart
Class Chart<M>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.chart.client.draw.DrawComponent
                  extended by com.sencha.gxt.chart.client.chart.Chart<M>
Type Parameters:
M - the data type to be used by this Chart
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, SpriteHandler.HasSpriteHandlers, SpriteOutEvent.HasSpriteOutHandlers, SpriteOverEvent.HasSpriteOverHandlers, SpriteSelectionEvent.HasSpriteSelectionHandlers, BeforeHideEvent.HasBeforeHideHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId

public class Chart<M>
extends DrawComponent

The Chart package provides the capability to visualize data.


Nested Class Summary
static class Chart.Position
          Enumeration used for items positioned on the chart.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Chart()
          Creates a chart with default width and height.
Chart(int width, int height)
          Creates a chart with the given width and height.
 
Method Summary
 void addAxis(Axis<M,?> axis)
          Adds an axis to the chart.
 void addSeries(Series<M> series)
          Adds a Series to the chart.
 void bindStore(ListStore<M> store)
          Binds the store to the chart so that any store events will automatically redraw the chart.
 void calculateMaximumGutter()
          Calculates the maximum gutter of the chart's series.
 int getAnimationDuration()
          Returns the duration of animations on the chart.
 EasingFunction getAnimationEasing()
          Returns the EasingFunction used by animations on the chart.
 Map<Chart.Position,Axis<M,?>> getAxes()
          Returns the map of axes currently added to the chart.
 Axis<M,?> getAxis(Chart.Position position)
          Returns the Axis at the given Chart.Position.
 PreciseRectangle getBBox()
          Returns the bounding box of the chart.
 ListStore<M> getCurrentStore()
          Returns the store currently being used by the chart.
 double getDefaultInsets()
          Returns the initial insets of the chart.
 Legend<M> getLegend()
          Returns the legend of the chart.
 double[] getMaxGutter()
          Returns maximum gutter of the series in the chart.
 List<Series<M>> getSeries()
          Returns all of the series attached to the chart.
 Series<M> getSeries(int index)
          Returns the series attached to the chart at the given index.
 ListStore<M> getStore()
          Returns the data store bound to the chart.
 PreciseRectangle getZoom()
          Returns the zoom of the chart.
 boolean hasShadows()
          Returns whether or not the chart has shadows.
 boolean isResizing()
          Returns whether or not the chart is resizing.
 void onMouseDown(Event event)
          Method used when the chart is clicked.
 void onMouseMove(Event event)
          Method used when the mouse moves over the chart.
 void onMouseOut(Event event)
          Method used when the mouse leaves the chart.
 void onResize(int width, int height)
           
 void redrawChart()
          Redraws all elements of the chart.
 void redrawChartForced()
          Redraws all elements of the chart immediatley.
 Axis<M,?> removeAxis(Axis<M,?> axis)
          Removes the Axis from the chart.
 Axis<M,?> removeAxis(Chart.Position position)
          Removes the Axis at the given Chart.Position from the chart.
 void removeLegend()
          Removes the Legend currently attached legend from the chart.
 boolean removeSeries(int index)
          Removes the given Series from the chart.
 boolean removeSeries(Series<M> series)
          Removes the given Series from the chart.
 void setAnimationDuration(int animationDuration)
          Sets the duration of animations on the chart.
 void setAnimationEasing(EasingFunction animationEasing)
          Sets the EasingFunction used by animations on the chart.
 void setChartShadow(boolean shadow)
          Sets whether or not the chart has shadows.
 void setDefaultInsets(double defaultInsets)
          Sets the initial insets of the chart.
 void setLegend(Legend<M> legend)
          Sets the legend of the chart.
 void setPixelSize(int width, int height)
           
 void setStore(ListStore<M> store)
          Sets the data store bound to the chart.
 void setSubstore(ListStore<M> substore)
          Sets a temporary substore for the chart.
 void setZoom(PreciseRectangle zoom)
          Sets the zoom of the chart.
 
Methods inherited from class com.sencha.gxt.chart.client.draw.DrawComponent
addGradient, addSprite, addSpriteHandler, addSpriteOutHandler, addSpriteOverHandler, addSpriteSelectionHandler, getBackground, getSurface, isAnimated, isViewBox, onBrowserEvent, redrawSurface, redrawSurfaceForced, remove, renderSprite, setAnimated, setBackground, setViewBox, sinkBrowserEvents
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeHandler, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chart

public Chart()
Creates a chart with default width and height.


Chart

public Chart(int width,
             int height)
Creates a chart with the given width and height.

Parameters:
width - the width of the chart
height - the height of the chart
Method Detail

addAxis

public void addAxis(Axis<M,?> axis)
Adds an axis to the chart. Only one axis for each Chart.Position can be added.

Parameters:
axis - the axis to be added

addSeries

public void addSeries(Series<M> series)
Adds a Series to the chart.

Parameters:
series - the series to be added

bindStore

public void bindStore(ListStore<M> store)
Binds the store to the chart so that any store events will automatically redraw the chart.

Parameters:
store - the store to be bound

calculateMaximumGutter

public void calculateMaximumGutter()
Calculates the maximum gutter of the chart's series.


getAnimationDuration

public int getAnimationDuration()
Returns the duration of animations on the chart.

Returns:
the duration of animations on the chart

getAnimationEasing

public EasingFunction getAnimationEasing()
Returns the EasingFunction used by animations on the chart.

Returns:
the easing function used by animations on the chart

getAxes

public Map<Chart.Position,Axis<M,?>> getAxes()
Returns the map of axes currently added to the chart.

Returns:
the map of axes currently added to the chart

getAxis

public Axis<M,?> getAxis(Chart.Position position)
Returns the Axis at the given Chart.Position.

Parameters:
position - the position of the axis
Returns:
the axis at the given position

getBBox

public PreciseRectangle getBBox()
Returns the bounding box of the chart.

Returns:
the bounding box of the chart

getCurrentStore

public ListStore<M> getCurrentStore()
Returns the store currently being used by the chart.

Returns:
the store currently being used by the chart

getDefaultInsets

public double getDefaultInsets()
Returns the initial insets of the chart.

Returns:
the initial insets of the chart

getLegend

public Legend<M> getLegend()
Returns the legend of the chart.

Returns:
the legend of the chart

getMaxGutter

public double[] getMaxGutter()
Returns maximum gutter of the series in the chart.

Returns:
maximum gutter of the series in the chart

getSeries

public List<Series<M>> getSeries()
Returns all of the series attached to the chart.

Returns:
all of the series attached to the chart

getSeries

public Series<M> getSeries(int index)
Returns the series attached to the chart at the given index.

Parameters:
index - the index of the series
Returns:
the series attached to the chart

getStore

public ListStore<M> getStore()
Returns the data store bound to the chart.

Returns:
the data store bound to the chart

getZoom

public PreciseRectangle getZoom()
Returns the zoom of the chart.

Returns:
the zoom of the chart

hasShadows

public boolean hasShadows()
Returns whether or not the chart has shadows.

Returns:
true if shadows

isResizing

public boolean isResizing()
Returns whether or not the chart is resizing.

Returns:
true if resizing

onMouseDown

public void onMouseDown(Event event)
Method used when the chart is clicked.

Overrides:
onMouseDown in class DrawComponent
Parameters:
event - the mouse event

onMouseMove

public void onMouseMove(Event event)
Method used when the mouse moves over the chart.

Overrides:
onMouseMove in class DrawComponent
Parameters:
event - the mouse event

onMouseOut

public void onMouseOut(Event event)
Method used when the mouse leaves the chart.

Overrides:
onMouseOut in class DrawComponent
Parameters:
event - the mouse event

onResize

public void onResize(int width,
                     int height)

redrawChart

public void redrawChart()
Redraws all elements of the chart.


redrawChartForced

public void redrawChartForced()
Redraws all elements of the chart immediatley.


removeAxis

public Axis<M,?> removeAxis(Axis<M,?> axis)
Removes the Axis from the chart.

Parameters:
axis - the axis to remove
Returns:
the removed axis

removeAxis

public Axis<M,?> removeAxis(Chart.Position position)
Removes the Axis at the given Chart.Position from the chart.

Parameters:
position - the position of the axis to remove
Returns:
the removed axis

removeLegend

public void removeLegend()
Removes the Legend currently attached legend from the chart.


removeSeries

public boolean removeSeries(int index)
Removes the given Series from the chart.

Parameters:
index - the index of the series to be removed
Returns:
true if the series is removed

removeSeries

public boolean removeSeries(Series<M> series)
Removes the given Series from the chart.

Parameters:
series - the series to be removed
Returns:
true if the series is removed

setAnimationDuration

public void setAnimationDuration(int animationDuration)
Sets the duration of animations on the chart.

Parameters:
animationDuration - the duration of animations on the chart

setAnimationEasing

public void setAnimationEasing(EasingFunction animationEasing)
Sets the EasingFunction used by animations on the chart.

Parameters:
animationEasing - the easing function used by animations on the chart

setChartShadow

public void setChartShadow(boolean shadow)
Sets whether or not the chart has shadows.

Parameters:
shadow - true if shadows

setDefaultInsets

public void setDefaultInsets(double defaultInsets)
Sets the initial insets of the chart.

Parameters:
defaultInsets - the initial insets of the chart

setLegend

public void setLegend(Legend<M> legend)
Sets the legend of the chart.

Parameters:
legend - the legend of the chart

setPixelSize

public void setPixelSize(int width,
                         int height)
Overrides:
setPixelSize in class Component

setStore

public void setStore(ListStore<M> store)
Sets the data store bound to the chart.

Parameters:
store - the data store

setSubstore

public void setSubstore(ListStore<M> substore)
Sets a temporary substore for the chart. Used by TimeAxis.

Parameters:
substore - substore for the chart

setZoom

public void setZoom(PreciseRectangle zoom)
Sets the zoom of the chart.

Parameters:
zoom - the zoom of the chart


Copyright © 2011. All Rights Reserved.