Class Chart
- java.lang.Object
-
- org.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
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
public class Chart extends Imagemap
The generic chart component. Developers set proper chart type, data model, and the threeD (3D) attribute to draw proper chart.Chart requires an implementation of an engine (
ChartEngine). The default engine is based on JFreeChart and available in ZK PE and ZK EE.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 CategoryModelorXYModelNo bar CategoryModelYes bubble XYZModelNo candlestick HiLoModelNo dial @{link DialModel} No gantt GanttModelNo highlow HiLoModelNo histogram XYModelNo line CategoryModelorXYModelYes pie PieModelYes polar XYModelNo ring PieModelNo scatter XYModelNo stacked_bar CategoryModelYes stacked_area CategoryModelorXYModelNo step XYModelNo step_area XYModelNo time_series XYModelNo wafermap WaferMapModelNo waterfall CategoryModelNo wind XYZModelNo - Author:
- henrichen
- See Also:
ChartEngine,ChartModel, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.zkoss.zul.Image
Image.ExtraCtrl
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAREAstatic java.lang.StringBARstatic java.lang.StringBUBBLEstatic java.lang.StringCANDLESTICKstatic java.lang.StringCOMBINATIONstatic java.lang.StringDAYstatic java.lang.StringDIALstatic java.lang.StringFUNNELstatic java.lang.StringGANTTstatic java.lang.StringHIGHLOWstatic java.lang.StringHISTOGRAMstatic java.lang.StringHOURstatic java.lang.StringLINEstatic java.lang.StringMILLISECONDstatic java.lang.StringMINUTEstatic java.lang.StringMONTHstatic java.lang.StringPIEstatic java.lang.StringPOLARstatic java.lang.StringQUARTERstatic java.lang.StringRINGstatic java.lang.StringSCATTERstatic java.lang.StringSECONDstatic java.lang.StringSTACKED_AREAstatic java.lang.StringSTACKED_BARstatic java.lang.StringSTEPstatic java.lang.StringSTEP_AREAstatic java.lang.StringTIME_SERIESstatic java.lang.StringWAFERMAPstatic java.lang.StringWATERFALLstatic java.lang.StringWEEKstatic java.lang.StringWINDstatic java.lang.StringYEAR
-
Constructor Summary
Constructors Constructor Description Chart()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddEventListener(java.lang.String evtnm, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event> listener)java.lang.Objectclone()ChartAreaListenergetAreaListener()Returns the renderer to render each area, or null if the default renderer is used.intgetBgAlpha()Get the background alpha (transparency, 0 ~ 255, opaque).java.lang.StringgetBgColor()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).java.lang.StringgetDateFormat()Returns the date format used by date related Chart.ChartEnginegetEngine()Returns the implementation chart engine.intgetFgAlpha()Get the foreground alpha (transparency, 0 ~ 255, opaque).intgetIntHeight()Get the chart int width in pixel; to be used by the derived subclass.intgetIntWidth()Get the chart int width in pixel; to be used by the derived subclass.java.awt.FontgetLegendFont()Returns the legend font of this chart.ChartModelgetModel()Returns the chart model associated with this chart, or null if this chart is not associated with any chart data model.java.lang.StringgetOrient()Get the chart orientation (vertical or horizontal)intgetPaneAlpha()Get the pane alpha (transparency, 0 ~ 255, opacue).java.lang.StringgetPaneColor()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.StringgetPeriod()Returns the period used in Time Series Chart.java.util.TimeZonegetTimeZone()Returns the time zone that this Time Series Chart belongs to, or null if the default time zone is used.java.lang.StringgetTitle()Get the chart's title.java.awt.FontgetTitleFont()Returns the title font of this chart.java.lang.StringgetType()Get the chart's type.java.lang.StringgetXAxis()Get the label in xAxis.java.awt.FontgetXAxisFont()Returns the label font of x axis of this chart.java.awt.FontgetXAxisTickFont()Returns the tick number font of x axis of this chart.java.lang.StringgetYAxis()Get the label in yAxis.java.awt.FontgetYAxisFont()Returns the label font of y axis of this chart.java.awt.FontgetYAxisTickFont()Returns the tick number font of y axis of this chart.booleanisShowLegend()Check whether show the legend of the chart.booleanisShowTooltiptext()Check whether show the tooltiptext.booleanisThreeD()Whether a 3d chart.protected ChartEnginenewChartEngine()Instantiates the default chart engine.voidonPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)voidonPageDetached(org.zkoss.zk.ui.Page page)voidsetAreaListener(java.lang.String clsnm)Sets the renderer by use of a class name.voidsetAreaListener(ChartAreaListener listener)Sets the renderer which is used to render each area.voidsetBgAlpha(int alpha)Set the background alpha (transparency, 0 ~ 255).voidsetBgColor(java.lang.String color)Set the background color of the chart.voidsetDateFormat(java.lang.String format)Sets the date format used by date related Chart.voidsetEngine(java.lang.String clsnm)Sets the chart engine by use of a class name.voidsetEngine(ChartEngine engine)Sets the chart engine.voidsetFgAlpha(int alpha)Set the foreground alpha (transparency, 0 ~ 255).voidsetHeight(java.lang.String h)Override super class to prepare the int height.voidsetHflex(java.lang.String flex)Overrides the method in HtmlBasedComponent, not to check using hflex and width at the same timevoidsetLegendFont(java.awt.Font font)Sets the legend font of this chart.voidsetModel(java.lang.String clsnm)Sets the model by use of a class name.voidsetModel(ChartModel model)Sets the chart model associated with this chart.voidsetOrient(java.lang.String orient)Set the chart orientation.voidsetPaneAlpha(int alpha)Set the pane alpha (transparency, 0 ~ 255).voidsetPaneColor(java.lang.String color)Set the pane color of the chart.voidsetPeriod(java.lang.String period)Sets the period used in Time Series Chart.voidsetShowLegend(boolean showLegend)whether show the chart's legend.voidsetShowTooltiptext(boolean showTooltiptext)whether show the chart's tooltip.voidsetThreeD(boolean b)Set true to show three dimensional graph (If a type of chart got no 3d peer, this is ignored).voidsetTimeZone(java.util.TimeZone tzone)Sets the time zone that this Time Series Chart belongs to, or null if the default time zone is used.voidsetTitle(java.lang.String title)Set the chart's title.voidsetTitleFont(java.awt.Font font)Sets the title font of this chart.voidsetType(java.lang.String type)Set the chart's type (Chart.PIE, Chart.BAR, Chart.LINE, etc.).voidsetVflex(java.lang.String flex)Overrides the method in HtmlBasedComponent, not to check using vflex and height at the same timevoidsetWidth(java.lang.String w)Override super class to prepare the int width.voidsetXAxis(java.lang.String label)Set the label in xAxis.voidsetXAxisFont(java.awt.Font axisFont)Sets the label font of x axis of this chart.voidsetXAxisTickFont(java.awt.Font axisTickFont)Sets the tick number font of x axis of this chart.voidsetYAxis(java.lang.String label)Set the label in yAxis.voidsetYAxisFont(java.awt.Font axisFont)Sets the label font of y axis of this chart.voidsetYAxisTickFont(java.awt.Font axisTickFont)Sets the tick number font of y axis of this chart.protected voidsmartDrawChart()mark a draw flag to inform that this Chart needs update.-
Methods inherited from class org.zkoss.zul.Imagemap
beforeChildAdded, isChildable
-
Methods inherited from class org.zkoss.zul.Image
getContent, getExtraCtrl, getHover, getSrc, renderProperties, setContent, setContent, setHover, setHoverContent, setHoverContent, setSrc
-
Methods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
-
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight0, setHeightDirectly, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex0, setVflexDirectly, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
-
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
-
-
-
Field Detail
-
PIE
public static final java.lang.String PIE
- See Also:
- Constant Field Values
-
FUNNEL
public static final java.lang.String FUNNEL
- See Also:
- Constant Field Values
-
RING
public static final java.lang.String RING
- See Also:
- Constant Field Values
-
BAR
public static final java.lang.String BAR
- See Also:
- Constant Field Values
-
LINE
public static final java.lang.String LINE
- See Also:
- Constant Field Values
-
AREA
public static final java.lang.String AREA
- See Also:
- Constant Field Values
-
STACKED_BAR
public static final java.lang.String STACKED_BAR
- See Also:
- Constant Field Values
-
COMBINATION
public static final java.lang.String COMBINATION
- See Also:
- Constant Field Values
-
STACKED_AREA
public static final java.lang.String STACKED_AREA
- See Also:
- Constant Field Values
-
WATERFALL
public static final java.lang.String WATERFALL
- See Also:
- Constant Field Values
-
POLAR
public static final java.lang.String POLAR
- See Also:
- Constant Field Values
-
SCATTER
public static final java.lang.String SCATTER
- See Also:
- Constant Field Values
-
TIME_SERIES
public static final java.lang.String TIME_SERIES
- See Also:
- Constant Field Values
-
STEP
public static final java.lang.String STEP
- See Also:
- Constant Field Values
-
STEP_AREA
public static final java.lang.String STEP_AREA
- See Also:
- Constant Field Values
-
HISTOGRAM
public static final java.lang.String HISTOGRAM
- See Also:
- Constant Field Values
-
CANDLESTICK
public static final java.lang.String CANDLESTICK
- See Also:
- Constant Field Values
-
HIGHLOW
public static final java.lang.String HIGHLOW
- See Also:
- Constant Field Values
-
BUBBLE
public static final java.lang.String BUBBLE
- See Also:
- Constant Field Values
-
WAFERMAP
public static final java.lang.String WAFERMAP
- See Also:
- Constant Field Values
-
GANTT
public static final java.lang.String GANTT
- See Also:
- Constant Field Values
-
WIND
public static final java.lang.String WIND
- See Also:
- Constant Field Values
-
DIAL
public static final java.lang.String DIAL
- See Also:
- Constant Field Values
-
YEAR
public static final java.lang.String YEAR
- See Also:
- Constant Field Values
-
QUARTER
public static final java.lang.String QUARTER
- See Also:
- Constant Field Values
-
MONTH
public static final java.lang.String MONTH
- See Also:
- Constant Field Values
-
WEEK
public static final java.lang.String WEEK
- See Also:
- Constant Field Values
-
DAY
public static final java.lang.String DAY
- See Also:
- Constant Field Values
-
HOUR
public static final java.lang.String HOUR
- See Also:
- Constant Field Values
-
MINUTE
public static final java.lang.String MINUTE
- See Also:
- Constant Field Values
-
SECOND
public static final java.lang.String SECOND
- See Also:
- Constant Field Values
-
MILLISECOND
public static final java.lang.String MILLISECOND
- See Also:
- Constant Field Values
-
-
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 b)
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.
-
setWidth
public void setWidth(java.lang.String w)
Override super class to prepare the int width.- Overrides:
setWidthin classorg.zkoss.zk.ui.HtmlBasedComponent
-
setHflex
public void setHflex(java.lang.String flex)
Overrides the method in HtmlBasedComponent, not to check using hflex and width at the same time- Overrides:
setHflexin classorg.zkoss.zk.ui.HtmlBasedComponent- Since:
- 8.0.1
-
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:
setHeightin classorg.zkoss.zk.ui.HtmlBasedComponent
-
setVflex
public void setVflex(java.lang.String flex)
Overrides the method in HtmlBasedComponent, not to check using vflex and height at the same time- Overrides:
setVflexin classorg.zkoss.zk.ui.HtmlBasedComponent- Since:
- 8.0.1
-
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.
-
setPaneAlpha
public 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
public int getPaneAlpha()
Get the pane alpha (transparency, 0 ~ 255, opacue).
-
setPaneColor
public void setPaneColor(java.lang.String color)
Set the pane color of the chart.- Parameters:
color- in #RRGGBB format (hexadecimal).
-
getPaneColor
public java.lang.String getPaneColor()
Get the pane color of the chart (in string as #RRGGBB). null means default.
-
getPaneRGB
public int[] getPaneRGB()
Get the pane color in int array (0: red, 1: green, 2:blue). null means default.
-
setFgAlpha
public 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
public int getFgAlpha()
Get the foreground alpha (transparency, 0 ~ 255, opaque).
-
setBgAlpha
public 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
public int getBgAlpha()
Get the background alpha (transparency, 0 ~ 255, opaque).
-
setBgColor
public void setBgColor(java.lang.String color)
Set the background color of the chart.- Parameters:
color- in #RRGGBB format (hexadecimal).
-
getBgColor
public java.lang.String getBgColor()
Get the background color of the chart (in string as #RRGGBB). null means default.
-
getBgRGB
public int[] getBgRGB()
Get the background color in int array (0: red, 1: green, 2:blue). null means default.
-
setOrient
public void setOrient(java.lang.String orient)
Set the chart orientation.- 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().
-
getPeriod
public 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
public 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
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.- Parameters:
format-
-
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:
org.zkoss.zk.ui.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.InvocationTargetExceptionSets the model by use of a class name. It creates an instance automatically.- Throws:
java.lang.ClassNotFoundExceptionjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getTitleFont
public java.awt.Font getTitleFont()
Returns the title font of this chart. If you saw squares rather than correct words in title, check whether the default title font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Returns:
- the title font
-
setTitleFont
public void setTitleFont(java.awt.Font font)
Sets the title font of this chart. If you saw squares rather than correct words in title, check whether the default title font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Parameters:
font- the title font of this chart
-
getLegendFont
public java.awt.Font getLegendFont()
Returns the legend font of this chart. If you saw squares rather than correct words in legend, check whether the default legend font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Returns:
- the title font
-
setLegendFont
public void setLegendFont(java.awt.Font font)
Sets the legend font of this chart. If you saw squares rather than correct words in legend, check whether the default legend font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Parameters:
font- the legend font of this chart
-
getXAxisTickFont
public java.awt.Font getXAxisTickFont()
Returns the tick number font of x axis of this chart. If you saw squares rather than correct words in x axis tick, check whether the default x axis tick font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Returns:
- the tick number font of x axis of this chart
-
setXAxisTickFont
public void setXAxisTickFont(java.awt.Font axisTickFont)
Sets the tick number font of x axis of this chart. If you saw squares rather than correct words in x axis tick, check whether the default x axis tick font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Parameters:
axisTickFont- the tick number font of x axis of this chart
-
getXAxisFont
public java.awt.Font getXAxisFont()
Returns the label font of x axis of this chart. If you saw squares rather than correct words in x axis label, check whether the default x axis label font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Returns:
- the label font of x axis of this chart
-
setXAxisFont
public void setXAxisFont(java.awt.Font axisFont)
Sets the label font of x axis of this chart. If you saw squares rather than correct words in x axis label, check whether the default x axis label font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Parameters:
axisFont- the label font of x axis of this chart
-
getYAxisTickFont
public java.awt.Font getYAxisTickFont()
Returns the tick number font of y axis of this chart. If you saw squares rather than correct words in y axis tick, check whether the default y axis tick font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Returns:
- the tick number font of y axis of this chart
-
setYAxisTickFont
public void setYAxisTickFont(java.awt.Font axisTickFont)
Sets the tick number font of y axis of this chart. If you saw squares rather than correct words in y axis tick, check whether the default y axis tick font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Parameters:
axisTickFont- the tick number font of y axis of this chart
-
getYAxisFont
public java.awt.Font getYAxisFont()
Returns the label font of y axis of this chart. If you saw squares rather than correct words in y axis label, check whether the default y axis label font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Returns:
- the label font of y axis of this chart
-
setYAxisFont
public void setYAxisFont(java.awt.Font axisFont)
Sets the label font of y axis of this chart. If you saw squares rather than correct words in y axis label, check whether the default y axis label font supports your characters (e.g. Chinese). You probably have to set this font accordingly.- Parameters:
axisFont- the tick number font of y axis of this chart
-
getEngine
public ChartEngine getEngine() throws org.zkoss.zk.ui.UiException
Returns the implementation chart engine.- Throws:
org.zkoss.zk.ui.UiException- if failed to load the engine.
-
newChartEngine
protected ChartEngine newChartEngine() throws org.zkoss.zk.ui.UiException
Instantiates the default chart engine. It is called, ifsetEngine(org.zkoss.zul.impl.ChartEngine)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
ChartEngine). If not found,UiExceptionis thrown.Derived class might override this method to provide your own default class.
- Throws:
org.zkoss.zk.ui.UiException- if failed to instantiate the engine- Since:
- 3.0.0
-
setEngine
public void setEngine(ChartEngine 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.InvocationTargetExceptionSets the chart engine by use of a class name. It creates an instance automatically.- Throws:
java.lang.ClassNotFoundExceptionjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
getAreaListener
public ChartAreaListener getAreaListener()
Returns the renderer to render each area, or null if the default renderer is used.
-
setAreaListener
public 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:
org.zkoss.zk.ui.UiException- if failed to initialize.
-
setAreaListener
public void setAreaListener(java.lang.String clsnm) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetExceptionSets the renderer by use of a class name. It creates an instance automatically.- Throws:
java.lang.ClassNotFoundExceptionjava.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetException
-
smartDrawChart
protected void smartDrawChart()
mark a draw flag to inform that this Chart needs update.
-
addEventListener
public boolean addEventListener(java.lang.String evtnm, org.zkoss.zk.ui.event.EventListener<? extends org.zkoss.zk.ui.event.Event> listener)- Specified by:
addEventListenerin interfaceorg.zkoss.zk.ui.Component- Overrides:
addEventListenerin classorg.zkoss.zk.ui.AbstractComponent
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfaceorg.zkoss.zk.ui.Component- Overrides:
clonein classXulElement
-
onPageAttached
public void onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)- Specified by:
onPageAttachedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onPageAttachedin classorg.zkoss.zk.ui.AbstractComponent
-
onPageDetached
public void onPageDetached(org.zkoss.zk.ui.Page page)
- Specified by:
onPageDetachedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onPageDetachedin classorg.zkoss.zk.ui.AbstractComponent
-
-