|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Image
org.zkoss.zul.Imagemap
org.zkoss.zul.Chart
public class Chart
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 |
|---|---|---|
| pie | PieModel | o |
| ring | PieModel | x |
| bar | CategoryModel | o |
| line | CategoryModel or XYModel | o |
| area | CategoryModel or XYModel | x |
| stacked_bar | CategoryModel | o |
| stacked_area | CategoryModel or XYModel | x |
| waterfall | CategoryModel | x |
| polar | XYModel | x |
| scatter | XYModel | x |
| time_series | XYModel | x |
| polar | XYModel | x |
| step_area | XYModel | x |
| step | XYModel | x |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zul.Image |
|---|
Image.ExtraCtrl |
| Field Summary | |
|---|---|
static java.lang.String |
AREA
|
static java.lang.String |
BAR
|
static java.lang.String |
CANDLESTICK
|
static java.lang.String |
DAY
|
static java.lang.String |
HIGHLOW
|
static java.lang.String |
HISTOGRAM
|
static java.lang.String |
HOUR
|
static java.lang.String |
LINE
|
static java.lang.String |
MILLISECOND
|
static java.lang.String |
MINUTE
|
static java.lang.String |
MONTH
|
static java.lang.String |
PIE
|
static java.lang.String |
POLAR
|
static java.lang.String |
QUARTER
|
static java.lang.String |
RING
|
static java.lang.String |
SCATTER
|
static java.lang.String |
SECOND
|
static java.lang.String |
STACKED_AREA
|
static java.lang.String |
STACKED_BAR
|
static java.lang.String |
STEP
|
static java.lang.String |
STEP_AREA
|
static java.lang.String |
TIME_SERIES
|
static java.lang.String |
WATERFALL
|
static java.lang.String |
WEEK
|
static java.lang.String |
YEAR
|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
Chart()
|
|
| 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). |
int[] |
getBgRGB()
Get the background color in int array (0: red, 1: green, 2:blue). |
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). |
int[] |
getPaneRGB()
Get the pane color in int array (0: red, 1: green, 2:blue). |
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 |
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 |
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 |
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 |
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.zul.Imagemap |
|---|
getOuterAttrs, insertBefore, isChildable |
| Methods inherited from class org.zkoss.zul.Image |
|---|
getAlign, getBorder, getContent, getHspace, getInnerAttrs, getSrc, getVspace, newExtraCtrl, setAlign, setBorder, setContent, setHspace, setSrc, setVspace, smartUpdate |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getAllOnClickAttrs, getContext, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, removeEventListener, setClass, setDraggable, setDroppable, setLeft, setSclass, setStyle, setTooltiptext, setTop, setZIndex |
| Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, toString, unsetVariable |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PIE
public static final java.lang.String RING
public static final java.lang.String BAR
public static final java.lang.String LINE
public static final java.lang.String AREA
public static final java.lang.String STACKED_BAR
public static final java.lang.String STACKED_AREA
public static final java.lang.String WATERFALL
public static final java.lang.String POLAR
public static final java.lang.String SCATTER
public static final java.lang.String TIME_SERIES
public static final java.lang.String STEP
public static final java.lang.String STEP_AREA
public static final java.lang.String HISTOGRAM
public static final java.lang.String CANDLESTICK
public static final java.lang.String HIGHLOW
public static final java.lang.String YEAR
public static final java.lang.String QUARTER
public static final java.lang.String MONTH
public static final java.lang.String WEEK
public static final java.lang.String DAY
public static final java.lang.String HOUR
public static final java.lang.String MINUTE
public static final java.lang.String SECOND
public static final java.lang.String MILLISECOND
| Constructor Detail |
|---|
public Chart()
| Method Detail |
|---|
public void setType(java.lang.String type)
public java.lang.String getType()
public void setThreeD(boolean b)
public boolean isThreeD()
public void setTitle(java.lang.String title)
title - the chart's title.public java.lang.String getTitle()
public void setWidth(java.lang.String w)
setWidth in class org.zkoss.zk.ui.HtmlBasedComponentpublic int getIntWidth()
public void setHeight(java.lang.String h)
setHeight in class org.zkoss.zk.ui.HtmlBasedComponentpublic int getIntHeight()
public void setXAxis(java.lang.String label)
label - label in xAxis.public java.lang.String getXAxis()
public void setYAxis(java.lang.String label)
label - label in yAxis.public java.lang.String getYAxis()
public void setShowLegend(boolean showLegend)
showLegend - true if want to show the legend (default to true).public boolean isShowLegend()
public void setShowTooltiptext(boolean showTooltiptext)
showTooltiptext - true if want to pop the tooltiptext (default to true).public boolean isShowTooltiptext()
public void setPaneAlpha(int alpha)
alpha - the transparency of pane color (0 ~ 255, default to 255 opaque).public int getPaneAlpha()
public void setPaneColor(java.lang.String color)
color - in #RRGGBB format (hexdecimal).public java.lang.String getPaneColor()
public int[] getPaneRGB()
public void setFgAlpha(int alpha)
alpha - the transparency of foreground color (0 ~ 255, default to 255 opaque).public int getFgAlpha()
public void setBgAlpha(int alpha)
alpha - the transparency of background color (0 ~ 255, default to 255 opaque).public int getBgAlpha()
public void setBgColor(java.lang.String color)
color - in #RRGGBB format (hexdecimal).public java.lang.String getBgColor()
public int[] getBgRGB()
public void setOrient(java.lang.String orient)
orient - vertical or horizontal (default to vertical)public java.lang.String getOrient()
public java.util.TimeZone getTimeZone()
The default time zone is determined by TimeZones.getCurrent().
public void setTimeZone(java.util.TimeZone tzone)
The default time zone is determined by TimeZones.getCurrent().
public java.lang.String getPeriod()
public void setPeriod(java.lang.String period)
public ChartModel getModel()
public void setModel(ChartModel model)
model - the chart model to associate, or null to dis-associate
any previous model.
org.zkoss.zk.ui.UiException - if failed to initialize with the model
public void setModel(java.lang.String clsnm)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetExceptionpublic ChartEngine getEngine()
public void setEngine(ChartEngine engine)
public void setEngine(java.lang.String clsnm)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetExceptionpublic ChartAreaListener getAreaListener()
public void setAreaListener(ChartAreaListener listener)
Note: changing a render will not cause the chart to re-render. If you want it to re-render, you could call smartDraw.
listener - the area listener, or null to ignore it.
org.zkoss.zk.ui.UiException - if failed to initialize.
public void setAreaListener(java.lang.String clsnm)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetExceptionprotected void smartDrawChart()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||