Chart

Components: chart

A chart is used to show a set of data as a graph. It helps users to judge things with a snapshot.

The usage of chart component is straightforward. Prepare suitable data model and feed it into the chart . The following is an example of pie chart.

<chart id="mychart" type="pie" width="400" height="200" threeD="true" fgAlpha="128">
<zscript><![CDATA[
 PieModel model = new SimplePieModel();
model.setValue("C/C++", new Double(17.5));
model.setValue("PHP", new Double(32.5));
model.setValue("Java", new Double(43.2));
model.setValue("VB", new Double(10.0));
mychart.setModel(model);
]]></zscript>
</chart>

Different kind of chart is used to demonstrate different kind of data; therefore, chart has to be provided suitable data model. For a pie chart, developers must provide PieModel as their data model while bar chart, line chart, area chart, and waterfall chart needs CategoryModel and XYModel.