Class Chart

    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

        com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
      • Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets

        com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
    • Constructor Summary

      Constructors 
      Constructor Description
      Chart()
      Constructor creates chart with default style
      Chart​(ChartStyle style)
      This constructor creates new chart instance with custom ChartStyle
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method 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.
      To update data call reload() method instead
      • Methods inherited from class com.google.gwt.user.client.ui.SimplePanel

        add, getContainerElement, getWidget, iterator, remove, setWidget, setWidget
      • Methods inherited from class com.google.gwt.user.client.ui.Panel

        add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
      • Methods inherited from class com.google.gwt.user.client.ui.Widget

        addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
      • Methods inherited from class com.google.gwt.user.client.ui.UIObject

        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
      • Methods inherited from interface com.google.gwt.event.shared.HasHandlers

        fireEvent
    • Constructor Detail

      • Chart

        public Chart​(ChartStyle style)
        This constructor creates new chart instance with custom ChartStyle
        Parameters:
        style - - new CssResource used for styling charts
      • Chart

        public Chart()
        Constructor creates chart with default style
    • Method Detail

      • setChartStyle

        public void setChartStyle​(ChartStyle style)
        Set new style to the char widget. New style will be injected automatically.
        NOTICE: new style will be applied after re-drawing of chart
        Parameters:
        style -
      • processEvents

        protected void processEvents​(com.google.gwt.core.client.JavaScriptObject object)
      • onAttach

        protected void onAttach()
        Overrides:
        onAttach in class com.google.gwt.user.client.ui.Widget
      • update

        public abstract void update()
        Method re-drawing chart widget without re-requesting data from data provider.
        To update data call reload() method instead
      • reload

        public abstract void reload()
        Method requesting data from data provider and re-drawing chart.
      • draw

        protected abstract void draw()
        Method preparing data and invoking native draw method
        This method should not be overridden by sub-classes
      • setPixelWidth

        public void setPixelWidth​(int width)
        Method sets pixel width of chart area
        Parameters:
        width - - width in pixels TODO: replace it with generic setWidth(String) and UIObject.setSize(String, String)
      • setWidth

        public void setWidth​(String width)
        Overrides:
        setWidth in class com.google.gwt.user.client.ui.UIObject
      • setHeight

        public void setHeight​(String height)
        Overrides:
        setHeight in class com.google.gwt.user.client.ui.UIObject
      • setPixelHeight

        public void setPixelHeight​(int height)
        Method sets pixel height of chart area
        Parameters:
        height - - height in pixels TODO: replace it with generic setHeight(String) and UIObject.setSize(String, String)
      • getSnapshot

        public com.google.gwt.user.client.ui.Image getSnapshot()
        Creates snapshot of current state of chart as image
        Returns:
        Image object or null if Chart not rendered (or in progress)
      • addClickHandler

        public com.google.gwt.event.shared.HandlerRegistration addClickHandler​(com.google.gwt.event.dom.client.ClickHandler clickHandler)
        Specified by:
        addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlers
      • getNativeCanvas

        protected com.google.gwt.core.client.JavaScriptObject getNativeCanvas()
      • getNativeElement

        protected com.google.gwt.dom.client.CanvasElement getNativeElement()
      • setNativeCanvas

        protected void setNativeCanvas​(com.google.gwt.core.client.JavaScriptObject object)
      • setAnimationEnabled

        public void setAnimationEnabled​(boolean enabled)
        Specify should chart be animated or not Default value is true
        Specified by:
        setAnimationEnabled in interface HasAnimation
        Parameters:
        enabled -
      • setAnimationSteps

        public void setAnimationSteps​(int steps)
        Description copied from interface: HasAnimation
        Particularly specify quality of animation Default value is 60
        Specified by:
        setAnimationSteps in interface HasAnimation
      • constructOptions

        protected com.google.gwt.core.client.JavaScriptObject constructOptions()
        Method returns custom options for chart
        Returns:
      • registerNativeAnimationHandlers

        protected void registerNativeAnimationHandlers()
      • onAnimationProgress

        protected void onAnimationProgress​(double progress)
      • onAnimationComplete

        protected void onAnimationComplete()
      • setLegendTemplate

        public void setLegendTemplate​(String template)