org.zkoss.zkmax.zul
Class Fusionchart

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zkmax.zul.Fusionchart
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Component, Scope, ComponentCtrl

public class Fusionchart
extends HtmlBasedComponent

The Fusionchart component. Developers set proper chart type, data model, and the threeD (3D) attribute to draw proper chart.

The model and type must match to each other; or the result is unpredictable. The 3D chart is not supported on all chart type.

typemodel VERTICAL 3D Horizontal 3D
areaCategoryModel or XYModelNoNo
barCategoryModelYesNo
ganttGanttModelNoNo
lineCategoryModel or XYModelYes
piePieModelYesYes
funnelSingleValueCategoryModelNoNo
stacked_barCategoryModelYesYes
stacked_areaCategoryModel or XYModelNoNo

Since:
6.0.1
Author:
jimmyshiau
See Also:
ChartModel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
HtmlBasedComponent.ExtraCtrl
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children
 
Field Summary
static java.lang.String ORIENT_HORIZONTAL
           
static java.lang.String ORIENT_VERTICAL
           
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
Fusionchart()
           
 
Method Summary
 java.lang.Object clone()
          Clones the component.
 AbstractChartConfig getChartConfig()
           
 java.lang.String getDataXMLPath()
          Get the url of the chart data .xml file.
 java.lang.String getDateFormat()
          Returns the date format used by date related Chart.
 FusionchartEngine<Fusionchart> getEngine()
           
 int getIntHeight()
          Get the chart int width in pixel; to be used by the derived subclass.
 int getIntWidth()
          Get the chart int width in pixel; to be used by the derived subclass.
 ChartModel getModel()
          Returns the chart model associated with this chart, or null if this chart is not associated with any chart data model.
 java.lang.String getOrient()
          Get the chart orientation (vertical or horizontal)
 java.lang.String getSubTitle()
          Get the chart's subtitle.
<T> ListModel<T>
getTableModel()
           
<T> GanttTableRenderer<T>
getTableRenderer()
           
 java.util.TimeZone getTimeZone()
          Returns the time zone that this Time Series Chart belongs to, or null if the default time zone is used.
 java.lang.String getTitle()
          Get the chart's title.
 java.lang.String getType()
          Get the chart's type.
 java.lang.String getXAxis()
          Get the label in xAxis.
 java.lang.String getYAxis()
          Get the label in yAxis.
 java.lang.String getZclass()
          Returns the ZK Cascading Style class(es) for this component.
 void invalidate()
          Invalidates this component by setting the dirty flag such that it will be redraw the whole content of this component and its dependences later.
 boolean isChildable()
          Not childable.
 boolean isShowLegend()
          Check whether show the legend of the chart.
 boolean isShowTooltiptext()
          Check whether show the tooltiptext.
 boolean isThreeD()
          Whether a 3d chart.
protected  FusionchartEngine<Fusionchart> newChartEngine()
          Instantiates the default chart engine.
protected  void renderProperties(ContentRenderer renderer)
          Renders the content of this component, excluding the enclosing tags and children.
 void service(AuRequest request, boolean everError)
          Processes an AU request.
 void setChartConfig(AbstractChartConfig chartConfig)
           
 void setDataXMLPath(java.lang.String url)
          Set the url of the chart data .xml file.
 void setDateFormat(java.lang.String format)
          Sets the date format used by date related Chart.
 void setEngine(FusionchartEngine<Fusionchart> engine)
          Sets the chart engine.
 void setEngine(java.lang.String clsnm)
          Sets the chart engine by use of a class name.
 void setHeight(java.lang.String h)
          Override super class to prepare the int height.
 void setModel(ChartModel model)
          Sets the chart model associated with this chart.
 void setModel(java.lang.String clsnm)
          Sets the model by use of a class name.
 void setOrient(java.lang.String orient)
          Set the chart orientation.
 void setShowLegend(boolean showLegend)
          whether show the chart's legend.
 void setShowTooltiptext(boolean showTooltiptext)
          whether show the chart's tooltip.
 void setSubTitle(java.lang.String subTitle)
          Set the chart's subtitle.
 void setTableModel(ListModel<?> model)
           
 void setTableRenderer(GanttTableRenderer<?> renderer)
           
 void setThreeD(boolean threeD)
          Set true to show three dimensional graph (If a type of chart got no 3d peer, this is ignored).
 void setTimeZone(java.util.TimeZone tzone)
          Sets the time zone that this Time Series Chart belongs to, or null if the default time zone is used.
 void setTitle(java.lang.String title)
          Set the chart's title.
 void setType(java.lang.String type)
          Set the chart's type (Chart.PIE, Chart.BAR, Chart.LINE, etc.).
 void setWidth(java.lang.String w)
          Override super class to prepare the int width.
 void setXAxis(java.lang.String label)
          Set the label in xAxis.
 void setYAxis(java.lang.String label)
          Set the label in yAxis.
protected  void smartDrawChart()
          mark a draw flag to inform that this Chart needs update.
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIENT_VERTICAL

public static final java.lang.String ORIENT_VERTICAL
See Also:
Constant Field Values

ORIENT_HORIZONTAL

public static final java.lang.String ORIENT_HORIZONTAL
See Also:
Constant Field Values
Constructor Detail

Fusionchart

public Fusionchart()
Method Detail

setType

public void setType(java.lang.String type)
Set the chart's type (Chart.PIE, Chart.BAR, Chart.LINE, etc.).

Default: pie.


getType

public java.lang.String getType()
Get the chart's type.


setThreeD

public void setThreeD(boolean threeD)
Set true to show three dimensional graph (If a type of chart got no 3d peer, this is ignored).


isThreeD

public boolean isThreeD()
Whether a 3d chart.


setTitle

public void setTitle(java.lang.String title)
Set the chart's title.

Parameters:
title - the chart's title.

getTitle

public java.lang.String getTitle()
Get the chart's title.


setSubTitle

public void setSubTitle(java.lang.String subTitle)
Set the chart's subtitle.

Parameters:
subTitle - the chart's subtitle.

getSubTitle

public java.lang.String getSubTitle()
Get the chart's subtitle.


setWidth

public void setWidth(java.lang.String w)
Override super class to prepare the int width.

Overrides:
setWidth in class HtmlBasedComponent
See Also:
HtmlBasedComponent.setWidthDirectly(java.lang.String), AbstractComponent.disableClientUpdate(boolean)

getIntWidth

public int getIntWidth()
Get the chart int width in pixel; to be used by the derived subclass.


setHeight

public void setHeight(java.lang.String h)
Override super class to prepare the int height.

Overrides:
setHeight in class HtmlBasedComponent

getIntHeight

public int getIntHeight()
Get the chart int width in pixel; to be used by the derived subclass.


setXAxis

public void setXAxis(java.lang.String label)
Set the label in xAxis.

Parameters:
label - label in xAxis.

getXAxis

public java.lang.String getXAxis()
Get the label in xAxis.


setYAxis

public void setYAxis(java.lang.String label)
Set the label in yAxis.

Parameters:
label - label in yAxis.

getYAxis

public java.lang.String getYAxis()
Get the label in yAxis.


setShowLegend

public void setShowLegend(boolean showLegend)
whether show the chart's legend.

Parameters:
showLegend - true if want to show the legend (default to true).

isShowLegend

public boolean isShowLegend()
Check whether show the legend of the chart.


setShowTooltiptext

public void setShowTooltiptext(boolean showTooltiptext)
whether show the chart's tooltip.

Parameters:
showTooltiptext - true if want to pop the tooltiptext (default to true).

isShowTooltiptext

public boolean isShowTooltiptext()
Check whether show the tooltiptext.


setOrient

public void setOrient(java.lang.String orient)
Set the chart orientation. Note:The two orient is no difference in Piechart.

Parameters:
orient - vertical or horizontal (default to vertical)

getOrient

public java.lang.String getOrient()
Get the chart orientation (vertical or horizontal)


getTimeZone

public java.util.TimeZone getTimeZone()
Returns the time zone that this Time Series Chart belongs to, or null if the default time zone is used.

The default time zone is determined by TimeZones.getCurrent().


setTimeZone

public void setTimeZone(java.util.TimeZone tzone)
Sets the time zone that this Time Series Chart belongs to, or null if the default time zone is used.

The default time zone is determined by TimeZones.getCurrent().


getDateFormat

public java.lang.String getDateFormat()
Returns the date format used by date related Chart.

Returns:
the date format used by date related Chart..

setDateFormat

public void setDateFormat(java.lang.String format)
Sets the date format used by date related Chart. This is the most important attribute, which you'll need to specify for all the Gantt charts that you build. With the help of this attribute, you're basically specifying the format in which you'll be providing your dates to FusionCharts.

Parameters:
format - MM/dd/yyyy or dd/MM/yyyy or yyyy/MM/dd (default to MM/dd/yyyy)

setDataXMLPath

public void setDataXMLPath(java.lang.String url)
Set the url of the chart data .xml file. See Fusionchart Free's FusionCharts Free Documentation for details.

Parameters:
url - the url path for the data xml path

getDataXMLPath

public java.lang.String getDataXMLPath()
Get the url of the chart data .xml file. See Fusionchart Free's FusionCharts Free Documentation for details.


getChartConfig

public AbstractChartConfig getChartConfig()

setChartConfig

public void setChartConfig(AbstractChartConfig chartConfig)

getTableRenderer

public <T> GanttTableRenderer<T> getTableRenderer()

setTableRenderer

public void setTableRenderer(GanttTableRenderer<?> renderer)

getModel

public ChartModel getModel()
Returns the chart model associated with this chart, or null if this chart is not associated with any chart data model.


setModel

public void setModel(ChartModel model)
Sets the chart model associated with this chart. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.

Parameters:
model - the chart model to associate, or null to dissociate any previous model.
Throws:
UiException - if failed to initialize with the model

setModel

public void setModel(java.lang.String clsnm)
              throws java.lang.ClassNotFoundException,
                     java.lang.NoSuchMethodException,
                     java.lang.IllegalAccessException,
                     java.lang.InstantiationException,
                     java.lang.reflect.InvocationTargetException
Sets the model by use of a class name. It creates an instance automatically.

Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException

getTableModel

public <T> ListModel<T> getTableModel()

setTableModel

public void setTableModel(ListModel<?> model)

getEngine

public FusionchartEngine<Fusionchart> getEngine()
                                         throws UiException
Throws:
UiException

newChartEngine

protected FusionchartEngine<Fusionchart> newChartEngine()
                                                 throws UiException
Instantiates the default chart engine. It is called, if setEngine(org.zkoss.zkmax.zul.fusionchart.FusionchartEngine) is not called with non-null engine.

By default, it looks up the library property called org.zkoss.zul.chart.engine.class. If found, the value is assumed to be the class name of the chart engine (it must implement FusionchartEngine). If not found, UiException is thrown.

Derived class might override this method to provide your own default class.

Throws:
UiException - if failed to instantiate the engine

setEngine

public void setEngine(FusionchartEngine<Fusionchart> engine)
Sets the chart engine.


setEngine

public void setEngine(java.lang.String clsnm)
               throws java.lang.ClassNotFoundException,
                      java.lang.NoSuchMethodException,
                      java.lang.IllegalAccessException,
                      java.lang.InstantiationException,
                      java.lang.reflect.InvocationTargetException
Sets the chart engine by use of a class name. It creates an instance automatically.

Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException

smartDrawChart

protected void smartDrawChart()
mark a draw flag to inform that this Chart needs update.


getZclass

public java.lang.String getZclass()
Description copied from class: HtmlBasedComponent
Returns the ZK Cascading Style class(es) for this component. It usually depends on the implementation of the mold (AbstractComponent.getMold()).

Default: null (the default value depends on element).

HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style of a component. In other words, the default style of a component is associated with the default value of HtmlBasedComponent.getZclass(). Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String) instead.

Overrides:
getZclass in class HtmlBasedComponent
See Also:
HtmlBasedComponent.getSclass()

clone

public java.lang.Object clone()
Description copied from interface: Component
Clones the component. All of its children and descendants are cloned. Also, ID are preserved.

Specified by:
clone in interface Component
Overrides:
clone in class HtmlBasedComponent
Returns:
the new component. Notice that it doesn't belong to any page, nor desktop. It doesn't have a parent, either.

service

public void service(AuRequest request,
                    boolean everError)
Description copied from class: HtmlBasedComponent
Processes an AU request.

Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.

Specified by:
service in interface ComponentCtrl
Overrides:
service in class HtmlBasedComponent
everError - whether any error ever occurred before processing this request.
See Also:
AbstractComponent.setAuService(org.zkoss.zk.au.AuService)

renderProperties

protected void renderProperties(ContentRenderer renderer)
                         throws java.io.IOException
Description copied from class: HtmlBasedComponent
Renders the content of this component, excluding the enclosing tags and children.

See also ZK Client-side Reference: Property Rendering

Overrides:
renderProperties in class HtmlBasedComponent
Throws:
java.io.IOException

invalidate

public void invalidate()
Description copied from interface: Component
Invalidates this component by setting the dirty flag such that it will be redraw the whole content of this component and its dependences later. And, the widget associated with this component and all its descendant at the client will be deleted and recreated, too.

If the application is totally controlled by the server side (i.e., you don't write client codes), you rarely need to access this method.

It can be called only in the request-processing and event-processing phases. However, it is NOT allowed in the rendering phase.

Specified by:
invalidate in interface Component
Overrides:
invalidate in class AbstractComponent

isChildable

public boolean isChildable()
Not childable.

Overrides:
isChildable in class AbstractComponent


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo