| org.zkoss.zul.Image org.zkoss.zul.Imagemap org.zkoss.zul.Chart
Chart | public class Chart extends Imagemap (Code) | | 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.
See Also: ChartEngine See Also: ChartModel author: henrichen |
Constructor Summary | |
public | Chart() |
Method Summary | |
static void | decode(String color, int[] rgb) | public ChartAreaListener | getAreaListener() Returns the renderer to render each area, or null if the default
renderer is used. | public int | getBgAlpha() Get the background alpha (transparency, 0 ~ 255, opacue). | public String | getBgColor() Get the background color of the chart (in string as #RRGGBB). | public int[] | getBgRGB() Get the background color in int array (0: red, 1: green, 2:blue). | public ChartEngine | getEngine() Returns the implemetation chart engine. | public int | getFgAlpha() Get the foreground alpha (transparency, 0 ~ 255, opacue). | public int | getIntHeight() Get the chart int width in pixel; to be used by the derived subclass. | public int | getIntWidth() Get the chart int width in pixel; to be used by the derived subclass. | public ChartModel | getModel() Returns the chart model associated with this chart, or null
if this chart is not associated with any chart data model. | public String | getOrient() | public int | getPaneAlpha() Get the pane alpha (transparency, 0 ~ 255, opacue). | public String | getPaneColor() Get the pane color of the chart (in string as #RRGGBB). | public int[] | getPaneRGB() Get the pane color in int array (0: red, 1: green, 2:blue). | public String | getPeriod() Returns the period used in Time Series Chart. | public TimeZone | getTimeZone() Returns the time zone that this Time Series Chart belongs to, or null if
the default time zone is used. | public String | getTitle() Get the chart's title. | public String | getType() Get the chart's type. | public String | getXAxis() Get the label in xAxis. | public String | getYAxis() Get the label in yAxis. | public boolean | isShowLegend() Check whether show the legend of the chart. | public boolean | isShowTooltiptext() Check whether show the tooltiptext. | public boolean | isThreeD() Whether a 3d chart. | protected ChartEngine | newChartEngine() Instantiates the default chart engine.
It is called, if
Chart.setEngine is not called with non-null
engine.
By default, it looks up the component attribute called
chart-engine. | public void | setAreaListener(ChartAreaListener listener) Sets the renderer which is used to render each area. | public void | setAreaListener(String clsnm) Sets the renderer by use of a class name. | public void | setBgAlpha(int alpha) Set the background alpha (transparency, 0 ~ 255). | public void | setBgColor(String color) Set the background color of the chart. | public void | setEngine(ChartEngine engine) Sets the chart engine. | public void | setEngine(String clsnm) Sets the chart engine by use of a class name. | public void | setFgAlpha(int alpha) Set the foreground alpha (transparency, 0 ~ 255). | public void | setHeight(String h) Override super class to prepare the int height. | public void | setModel(ChartModel model) Sets the chart model associated with this chart. | public void | setModel(String clsnm) Sets the model by use of a class name. | public void | setOrient(String orient) Set the chart orientation. | public void | setPaneAlpha(int alpha) Set the pane alpha (transparency, 0 ~ 255). | public void | setPaneColor(String color) Set the pane color of the chart. | public void | setPeriod(String period) Sets the period used in Time Series Chart. | public void | setShowLegend(boolean showLegend) whether show the chart's legend. | public void | setShowTooltiptext(boolean showTooltiptext) whether show the chart's tooltip. | public void | setThreeD(boolean b) Set true to show three dimensional graph (If a type of chart got no 3d peer, this is ignored). | public void | setTimeZone(TimeZone tzone) Sets the time zone that this Time Series Chart belongs to, or null if
the default time zone is used. | public void | setTitle(String title) Set the chart's title. | public void | setType(String type) Set the chart's type (Chart.PIE, Chart.BAR, Chart.LINE, etc.). | public void | setWidth(String w) Override super class to prepare the int width. | public void | setXAxis(String label) Set the label in xAxis. | public void | setYAxis(String label) Set the label in yAxis. | protected void | smartDrawChart() mark a draw flag to inform that this Chart needs update. | static int | stringToInt(String str) |
getAreaListener | public ChartAreaListener getAreaListener()(Code) | | Returns the renderer to render each area, or null if the default
renderer is used.
|
getBgAlpha | public int getBgAlpha()(Code) | | Get the background alpha (transparency, 0 ~ 255, opacue).
|
getBgColor | public String getBgColor()(Code) | | Get the background color of the chart (in string as #RRGGBB).
null means default.
|
getBgRGB | public int[] getBgRGB()(Code) | | Get the background color in int array (0: red, 1: green, 2:blue).
null means default.
|
getFgAlpha | public int getFgAlpha()(Code) | | Get the foreground alpha (transparency, 0 ~ 255, opacue).
|
getIntHeight | public int getIntHeight()(Code) | | Get the chart int width in pixel; to be used by the derived subclass.
|
getIntWidth | public int getIntWidth()(Code) | | Get the chart int width in pixel; to be used by the derived subclass.
|
getModel | public ChartModel getModel()(Code) | | Returns the chart model associated with this chart, or null
if this chart is not associated with any chart data model.
|
getOrient | public String getOrient()(Code) | | Get the chart orientation (vertical or horizontal)
|
getPaneAlpha | public int getPaneAlpha()(Code) | | Get the pane alpha (transparency, 0 ~ 255, opacue).
|
getPaneColor | public String getPaneColor()(Code) | | Get the pane color of the chart (in string as #RRGGBB).
null means default.
|
getPaneRGB | public int[] getPaneRGB()(Code) | | Get the pane color in int array (0: red, 1: green, 2:blue).
null means default.
|
getPeriod | public String getPeriod()(Code) | | 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.
|
getTitle | public String getTitle()(Code) | | Get the chart's title.
|
getXAxis | public String getXAxis()(Code) | | Get the label in xAxis.
|
getYAxis | public String getYAxis()(Code) | | Get the label in yAxis.
|
isShowLegend | public boolean isShowLegend()(Code) | | Check whether show the legend of the chart.
|
isShowTooltiptext | public boolean isShowTooltiptext()(Code) | | Check whether show the tooltiptext.
|
isThreeD | public boolean isThreeD()(Code) | | Whether a 3d chart.
|
newChartEngine | protected ChartEngine newChartEngine() throws UiException(Code) | | Instantiates the default chart engine.
It is called, if
Chart.setEngine is not called with non-null
engine.
By default, it looks up the component attribute called
chart-engine. If found, the value is assumed to be the class
or the class name of the default engine (it must implement
ChartEngine ).
If not found,
UiException is thrown.
Derived class might override this method to provide your
own default class.
exception: UiException - if failed to instantiate the engine since: 3.0.0 |
setAreaListener | public void setAreaListener(ChartAreaListener listener)(Code) | | 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. exception: UiException - if failed to initialize. |
setBgAlpha | public void setBgAlpha(int alpha)(Code) | | Set the background alpha (transparency, 0 ~ 255).
Parameters: alpha - the transparency of background color (0 ~ 255, default to 255 opaque). |
setBgColor | public void setBgColor(String color)(Code) | | Set the background color of the chart.
Parameters: color - in #RRGGBB format (hexdecimal). |
setFgAlpha | public void setFgAlpha(int alpha)(Code) | | Set the foreground alpha (transparency, 0 ~ 255).
Parameters: alpha - the transparency of foreground color (0 ~ 255, default to 255 opaque). |
setHeight | public void setHeight(String h)(Code) | | Override super class to prepare the int height.
|
setModel | public void setModel(ChartModel model)(Code) | | 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-associateany previous model. exception: UiException - if failed to initialize with the model |
setOrient | public void setOrient(String orient)(Code) | | Set the chart orientation.
Parameters: orient - vertical or horizontal (default to vertical) |
setPaneAlpha | public void setPaneAlpha(int alpha)(Code) | | Set the pane alpha (transparency, 0 ~ 255).
Parameters: alpha - the transparency of pane color (0 ~ 255, default to 255 opaque). |
setPaneColor | public void setPaneColor(String color)(Code) | | Set the pane color of the chart.
Parameters: color - in #RRGGBB format (hexdecimal). |
setPeriod | public void setPeriod(String period)(Code) | | Sets the period used in Time Series Chart. The value can be
"millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", and "year".
|
setShowLegend | public void setShowLegend(boolean showLegend)(Code) | | whether show the chart's legend.
Parameters: showLegend - true if want to show the legend (default to true). |
setShowTooltiptext | public void setShowTooltiptext(boolean showTooltiptext)(Code) | | whether show the chart's tooltip.
Parameters: showTooltiptext - true if want to pop the tooltiptext (default to true). |
setThreeD | public void setThreeD(boolean b)(Code) | | Set true to show three dimensional graph (If a type of chart got no 3d peer, this is ignored).
|
setTitle | public void setTitle(String title)(Code) | | Set the chart's title.
Parameters: title - the chart's title. |
setType | public void setType(String type)(Code) | | Set the chart's type (Chart.PIE, Chart.BAR, Chart.LINE, etc.).
Default: pie.
|
setWidth | public void setWidth(String w)(Code) | | Override super class to prepare the int width.
|
setXAxis | public void setXAxis(String label)(Code) | | Set the label in xAxis.
Parameters: label - label in xAxis. |
setYAxis | public void setYAxis(String label)(Code) | | Set the label in yAxis.
Parameters: label - label in yAxis. |
smartDrawChart | protected void smartDrawChart()(Code) | | mark a draw flag to inform that this Chart needs update.
|
|
|