-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm trying out the Zk charts, and noticed that I cannot set width to 100%. If my window have a 100% width, how can I calculate the Chart size?
I don't want to fix my window width because the browser can have the center (border layout) resized and I want the chart to fit the new width.
Any solutions for that?
<borderlayout hflex="1" vflex="1">
...
<center>
<window hflex="1" vflex="1" id="centerWindow">
<tabbox id="mainTabs" width="100%" height="100%" sclass="mainTabs">
<tabs>
<tab label="Chart Data" closable="true"/>
</tabs>
<tabpanels>
<tabpanel>
<include src='chart.zul' />
</tabpanel>
</tabpanels>
</tabbox>
</window>
</center>
...
</borderlayout>
At the moment charts only support a user defined width and height and no hflex/vflex or percentage A workaround to fit the chart automatically into the surrounding container is:
<div hflex="1" onAfterSize='chart.setWidth(event.getWidth() + "px")'>
<chart id="chart" type="area" />
</div>
Like that whenever the <div>
resizes to its parents width, it will update the width of the chart at the same time an trigger a rerender.
see AfterSizeEvent since 6.5.2
I have 2 pages one including another and I want to achieve the Chart resize (Responsiveness). But the chart size is not visible as I expected.
Please, any one can tell me what I am doing wrong!
page.zul
<panel hflex="1" vflex="1">
<panelchildren>
<hlayout hflex="6" vflex="1">
<div sclass="chart" hflex="4" vflex="1">
<include
src="chart.zul" />
</div>
<vlayout hflex="2"></vlayout>
</panelchildren>
</panel>
chart.zul
<div hflex="1">
<charts id="chart" type="column" hflex="1" />
</div>
Thanks.
Emma.
Try assigning the include component hflex and vflex also.
vincentjian ( 2015-08-11 01:16:36 +0800 )editDid you set hflex="1" and vflex="1" on include component? Also, ZK Charts support h/vflex since 2.0.0, which version are you using?
vincentjian ( 2015-08-12 02:13:42 +0800 )editI mean on include component. <include src="chart.zul" hflex="1" vflex="1" />
vincentjian ( 2015-08-12 07:39:12 +0800 )editAsked: 2013-06-20 21:41:29 +0800
Seen: 105 times
Last updated: Aug 06 '15