我想将以下代码转换为ActionScript(mxml可以正常工作):
<mx:Panel title="Some Title" width="400" height="300">
<s:Scroller width="100%" height="100%"/>
<mx:ColumnChart id="myChart" attribute="..." />
这不能直接使用:
setupChart(); //setup myChart
var scroll:Scroller = new Scroller();
scroll.percentWidth = 100;
scroll.percentHeight = 100;
scroll.viewport = myChart;
答案 0 :(得分:4)
添加小组首先适合我
setupChart();
var grp:Group = new Group();
grp.percentWidth = 100;
grp.percentHeight = 100;
grp.addElement( myChart );
var scroll:Scroller = new Scroller();
scroll.percentWidth = 100;
scroll.viewport = grp;