📄 chart.zul
字号:
<?xml version="1.0" encoding="UTF-8"?><!--chart.zul{{IS_NOTE Purpose: Description: History: Thu Nov 13 16:07:16 TST 2008, Created by Flyworld}}IS_NOTECopyright (C) 2008 Potix Corporation. All Rights Reserved.{{IS_RIGHT}}IS_RIGHT--><window id="demo" apply="org.zkoss.zkdemo.userguide.DemoWindowComposer"> <html><![CDATA[ <h4>Chart</h4> <p>Displays a set of data graphically. In this demo, change the value of the grid and the chart will be redrawn accordingly. Also, the chart can be drill down with a click on the pie.</p> ]]></html> <separator />
<tabbox width="100%" tabscroll="false">
<tabs>
<tab id="demoView" label="Demo"/>
<tab id="srcView" label="View Source"/>
</tabs>
<tabpanels>
<tabpanel>
<window id="view">
</window>
</tabpanel>
<tabpanel>
<panel>
<panelchildren>
<textbox id="codeView" class="code" rows="20" width="95%">
<attribute name="value"><![CDATA[<vbox> <grid width="400px"> <columns> <column label="category" width="150px" /> <column label="value" /> </columns> <rows> <row> <label id="c0" value="C/C++" /> <decimalbox id="v0" value="21.2" constraint="no empty" onChange="update(0)" /> </row> <row> <label id="c1" value="VB" /> <decimalbox id="v1" value="10.2" constraint="no empty" onChange="update(1)" /> </row> <row> <label id="c2" value="Java" /> <decimalbox id="v2" value="40.4" constraint="no empty" onChange="update(2)" /> </row> <row> <label id="c3" value="PHP" /> <decimalbox id="v3" value="28.2" constraint="no empty" onChange="update(3)" /> </row> </rows> </grid> <checkbox label="3D Chart" checked="true" onCheck="mychart.setThreeD(self.isChecked())" /> <chart id="mychart" title="Pie Chart Demo" width="500" height="250" type="pie" threeD="true" fgAlpha="128"> <attribute name="onClick"> String areaid = event.getArea(); if (areaid != null) { Area area = self.getFellow(areaid); alert(""+area.getAttribute("entity")+": "+area.getTooltiptext()); } </attribute> <zscript> void update(int rowIndex) { Label lb = (Label) self.getFellow("c"+rowIndex); Decimalbox db = (Decimalbox) self.getFellow("v"+rowIndex); model.setValue(lb.value, new Double(db.getValue().doubleValue())); } PieModel model = new SimplePieModel(); for(int j=0; j < 4; ++j) { update(j); } mychart.setModel(model); </zscript> </chart> <toolbarbutton label="See More chart..." href="morechart.zul" target="zkdemo"/></vbox>
]]></attribute>
</textbox>
</panelchildren>
<toolbar mold="panel">
<button id="tryBtn" label="Try me!"/>
<button id="reloadBtn" label="Reload" height="18px"/>
</toolbar>
</panel>
</tabpanel>
</tabpanels>
</tabbox></window>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -