A chart is used to show a set of data as a graph. It helps users to judge things with a snapshot. To use a chart component , developers must prepare a ChartModel and a ChartEngine. Developers also set proper chart type, 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.
Example
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
histogram
XYModel
x
candlestick
HiLoModel
x
hilow
HiLoModel
x
<vbox><chartid="mychart"title="Pie Chart Demo"width="500"height="250"type="pie"threeD="true"fgAlpha="128"/><zscript>
PieModel model = new MyPieModel();
mychart.setModel(model);
</zscript></vbox>
Areaarea=(Area)event.getAreaComponent();//must be Area or null when used with chartif(area!=null)...
5.0.3
June 2010
The area sent with the click event becomes UUID of the area component. Thus, use desktop.getComponentByUuid(event.getArea()). To write a program compatible with any version of ZK:
Stringareaid=event.getArea();if(areaid!=null){Areaarea=desktop.getComponentByUuidIfAny(areaid);if(area==null)area=chart.getFellow(areaid);//fall back to older version...