org.zkoss.zul.api
Interface Chart

All Superinterfaces:
java.lang.Cloneable, Component, HtmlBasedComponent, Image, Imagemap, Scope, java.io.Serializable, XulElement
All Known Implementing Classes:
Chart

public interface Chart
extends Imagemap

The generic chart 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.

type model 3D
area CategoryModel or XYModel No
bar CategoryModel Yes
bubble XYZModel No
candlestick HiLoModel No
gantt GanttModel No
hilow HiLoModel No
histogram XYModel No
line CategoryModel or XYModel Yes
pie PieModel Yes
polar XYModel No
ring PieModel No
scatter XYModel No
stacked_bar CategoryModel Yes
stacked_area CategoryModel or XYModel No
step XYModel No
step_area XYModel No
time_series XYModel No
wafermap WaferMapModel No
waterfall CategoryModel No
wind XYZModel No

Since:
3.5.2
Author:
henrichen
See Also:
ChartEngine, ChartModel

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 ChartAreaListener getAreaListener()
          Returns the renderer to render each area, or null if the default renderer is used.
 int getBgAlpha()
          Get the background alpha (transparency, 0 ~ 255, opacue).
 java.lang.String getBgColor()
          Get the background color of the chart (in string as #RRGGBB). null means default.
 int[] getBgRGB()
          Get the background color in int array (0: red, 1: green, 2:blue). null means default.
 java.lang.String getDateFormat()
          Returns the date format used by date related Chart.
 ChartEngine getEngine()
          Returns the implemetation chart engine.
 int getFgAlpha()
          Get the foreground alpha (transparency, 0 ~ 255, opacue).
 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)
 int getPaneAlpha()
          Get the pane alpha (transparency, 0 ~ 255, opacue).
 java.lang.String getPaneColor()
          Get the pane color of the chart (in string as #RRGGBB). null means default.
 int[] getPaneRGB()
          Get the pane color in int array (0: red, 1: green, 2:blue). null means default.
 java.lang.String getPeriod()
          Returns the period used in Time Series Chart.
 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.
 boolean isShowLegend()
          Check whether show the legend of the chart.
 boolean isShowTooltiptext()
          Check whether show the tooltiptext.
 boolean isThreeD()
          Whether a 3d chart.
 void setAreaListener(ChartAreaListener listener)
          Sets the renderer which is used to render each area.
 void setAreaListener(java.lang.String clsnm)
          Sets the renderer by use of a class name.
 void setBgAlpha(int alpha)
          Set the background alpha (transparency, 0 ~ 255).
 void setBgColor(java.lang.String color)
          Set the background color of the chart.
 void setDateFormat(java.lang.String format)
          Sets the date format used by date related Chart.
 void setEngine(ChartEngine engine)
          Sets the chart engine.
 void setEngine(java.lang.String clsnm)
          Sets the chart engine by use of a class name.
 void setFgAlpha(int alpha)
          Set the foreground alpha (transparency, 0 ~ 255).
 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 setPaneAlpha(int alpha)
          Set the pane alpha (transparency, 0 ~ 255).
 void setPaneColor(java.lang.String color)
          Set the pane color of the chart.
 void setPeriod(java.lang.String period)
          Sets the period used in Time Series Chart.
 void setShowLegend(boolean showLegend)
          whether show the chart's legend.
 void setShowTooltiptext(boolean showTooltiptext)
          whether show the chart's tooltip.
 void setThreeD(boolean b)
          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 setXAxis(java.lang.String label)
          Set the label in xAxis.
 void setYAxis(java.lang.String label)
          Set the label in yAxis.
 
Methods inherited from interface org.zkoss.zul.api.Image
getAlign, getBorder, getContent, getHover, getHspace, getSrc, getVspace, setAlign, setBorder, setContent, setContent, setHover, setHoverContent, setHoverContent, setHspace, setSrc, setVspace
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

setType

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

Default: pie.


getType

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


setThreeD

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


isThreeD

boolean isThreeD()
Whether a 3d chart.


setTitle

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

Parameters:
title - the chart's title.

getTitle

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


getIntWidth

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


getIntHeight

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


setXAxis

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

Parameters:
label - label in xAxis.

getXAxis

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


setYAxis

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

Parameters:
label - label in yAxis.

getYAxis

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


setShowLegend

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

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

isShowLegend

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


setShowTooltiptext

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

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

isShowTooltiptext

boolean isShowTooltiptext()
Check whether show the tooltiptext.


setPaneAlpha

void setPaneAlpha(int alpha)
Set the pane alpha (transparency, 0 ~ 255).

Parameters:
alpha - the transparency of pane color (0 ~ 255, default to 255 opaque).

getPaneAlpha

int getPaneAlpha()
Get the pane alpha (transparency, 0 ~ 255, opacue).


setPaneColor

void setPaneColor(java.lang.String color)
Set the pane color of the chart.

Parameters:
color - in #RRGGBB format (hexdecimal).

getPaneColor

java.lang.String getPaneColor()
Get the pane color of the chart (in string as #RRGGBB). null means default.


getPaneRGB

int[] getPaneRGB()
Get the pane color in int array (0: red, 1: green, 2:blue). null means default.


setFgAlpha

void setFgAlpha(int alpha)
Set the foreground alpha (transparency, 0 ~ 255).

Parameters:
alpha - the transparency of foreground color (0 ~ 255, default to 255 opaque).

getFgAlpha

int getFgAlpha()
Get the foreground alpha (transparency, 0 ~ 255, opacue).


setBgAlpha

void setBgAlpha(int alpha)
Set the background alpha (transparency, 0 ~ 255).

Parameters:
alpha - the transparency of background color (0 ~ 255, default to 255 opaque).

getBgAlpha

int getBgAlpha()
Get the background alpha (transparency, 0 ~ 255, opacue).


setBgColor

void setBgColor(java.lang.String color)
Set the background color of the chart.

Parameters:
color - in #RRGGBB format (hexdecimal).

getBgColor

java.lang.String getBgColor()
Get the background color of the chart (in string as #RRGGBB). null means default.


getBgRGB

int[] getBgRGB()
Get the background color in int array (0: red, 1: green, 2:blue). null means default.


setOrient

void setOrient(java.lang.String orient)
Set the chart orientation.

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

getOrient

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


getTimeZone

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

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().


getPeriod

java.lang.String getPeriod()
Returns the period used in Time Series Chart. The value can be "millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", and "year". default is "millisecond" if not specified.


setPeriod

void setPeriod(java.lang.String period)
Sets the period used in Time Series Chart. The value can be "millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", and "year".


getDateFormat

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

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

setDateFormat

void setDateFormat(java.lang.String format)
Sets the date format used by date related Chart.

Parameters:
format -

getModel

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


setModel

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 dis-associate any previous model.
Throws:
UiException - if failed to initialize with the model

setModel

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

getEngine

ChartEngine getEngine()
                      throws UiException
Returns the implemetation chart engine.

Throws:
UiException - if failed to load the engine.

setEngine

void setEngine(ChartEngine engine)
Sets the chart engine.


setEngine

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

getAreaListener

ChartAreaListener getAreaListener()
Returns the renderer to render each area, or null if the default renderer is used.


setAreaListener

void setAreaListener(ChartAreaListener listener)
Sets the renderer which is used to render each area.

Note: changing a render will not cause the chart to re-render. If you want it to re-render, you could call smartDraw.

Parameters:
listener - the area listener, or null to ignore it.
Throws:
UiException - if failed to initialize.

setAreaListener

void setAreaListener(java.lang.String clsnm)
                     throws java.lang.ClassNotFoundException,
                            java.lang.NoSuchMethodException,
                            java.lang.IllegalAccessException,
                            java.lang.InstantiationException,
                            java.lang.reflect.InvocationTargetException
Sets the renderer 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


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