问题描述
图表上边有一个查询区,查询区是可以折叠的。我想实现查询区折叠后,重新加载图表的高度(查询区和图表是同一页面,没有用Iframe)。下边是我大概的代码,我看了API,有一个myChart.resizeTo("100%","550");方法可以调整大小,但是不实用,它是调整了Flash的大小,但是图表的大小没有跟着改变,怪!请各位大侠吱招。<%@PageLanguage="C#"MasterPageFile="~/MasterPage/hyPageTemplate.Master"AutoEventWireup="true"CodeFile="Pie.aspx.cs"Inherits="HBManager_ComInfo_Pie"Title="无标题页"%><asp:ContentID="Content1"ContentPlaceHolderID="PageBody"runat="Server"><scripttype="text/javascript"src="<%=Page.ResolveClientUrl("~/")%>inc/FunsionChart3.2/js/FusionCharts.js"></script><scripttype="text/javascript"src="<%=Page.ResolveClientUrl("~/")%>inc/FunsionChart3.2/js/FusionChartsExportComponent.js"></script><styletype="text/css">body{background-color:#FFFFFF;}</style><divid="divSearch"style="border:0px#4BB5FFsolid;width:100%"><fieldsetclass="fieldBoder"><legendalign="left"style="font-size:9pt;"><divonclick="MyGroupBox(imgBase,tabBase);"style="cursor:pointer"><imgid="imgBase"src='<%=Page.ResolveClientUrl("~/")%>images/lthb/hydgweb/images/zoom_minus_icon.gif'alt=""/><spanid="tabpage1_1">查询区</span></div></legend><divid="tabBase"style=""><tablestyle="width:100%"><tr><tdclass="table_bodytable_body_NoWidth">统计要素</td><tdclass="table_nonetable_none_NoWidth"><asp:RadioButtonListID="rblYS"AutoPostBack="true"RepeatDirection="Horizontal"OnSelectedIndexChanged="rblYS_SelectedIndexChanged"runat="server"Width="225px"><asp:ListItemValue="所属行业"Selected="true">所属行业</asp:ListItem><asp:ListItemValue="所属地区">所属地区</asp:ListItem><asp:ListItemValue="单位类型">单位类型</asp:ListItem></asp:RadioButtonList></td></tr><tr><tdclass="table_bodytable_body_NoWidth">展示方式</td><tdclass="table_nonetable_none_NoWidth"><asp:RadioButtonListID="rblFS"AutoPostBack="true"RepeatDirection="Horizontal"OnSelectedIndexChanged="rblFS_SelectedIndexChanged"runat="server"Width="150px"><asp:ListItemValue="数量"Selected="true">数量</asp:ListItem><asp:ListItemValue="比例">比例</asp:ListItem></asp:RadioButtonList></td></tr></table></div></fieldset></div><divid="divOut"style="position:absolute;top:99px;right:118px;display:none;"></div><divid="divPrint"style="width:36px;height:15px;font-size:13px;color:#0372AB;font-family:Verdana;padding-left:10px;padding-top:3px;border:solid1px#0372AB;background-color:#E1f5ff;cursor:pointer;position:absolute;top:111px;right:100px;"onclick="printChart();">打印</div><divid="divFull"style="width:36px;height:15px;font-size:13px;color:#0372AB;font-family:Verdana;padding-left:10px;padding-top:3px;border:solid1px#0372AB;background-color:#E1f5ff;cursor:pointer;position:absolute;top:111px;right:46px;"onclick="showFullPage();">全屏</div><divid="DivMapWinInfo"style="width:100%;overflow-y:hidden;overflow:hidden;"></div><scripttype="text/javascript"charset="gb2312">varw=0;varh=0;varsearchH=0;varisFullPage='<%=IsFullPage%>';window.onload=function(){setTimeout("init();",2000);}functioninit(){searchH=document.getElementById('divSearch').offsetHeight+5;if(isFullPage=="Y"){document.getElementById("divSearch").style.display="none";document.getElementById("divFull").style.display="none";document.getElementById("divOut").style.display="";searchH=0;}else{w=document.documentElement.offsetWidth;h=document.documentElement.offsetHeight;}showPic();}varmyChart;functionshowPic(){if(isFullPage=="Y"){myChart=newFusionCharts("<%=Page.ResolveUrl("~/")%>inc/FunsionChart3.2/Charts3.2/<%=chartName%>","myChartId","100%","100%","0","0");}else{myChart=newFusionCharts("<%=Page.ResolveUrl("~/")%>inc/FunsionChart3.2/Charts3.2/<%=chartName%>","myChartId","100%",(h-searchH));}myChart.setDataXML("<%=strXML%>");myChart.render(DivMapWinInfo);outPic();}//打印functionprintChart(){//GetchartfromitsIDvarchartToPrint=getChartFromId("DivMapWinInfo");chartToPrint.print();}//出图functionoutPic(){varmyExportComponent=newFusionChartsExportObject("fcExporter1","<%=Page.ResolveUrl("~/")%>inc/FunsionChart3.2/Charts3.2/FCExporter.swf");//ButtonvisualconfigurationmyExportComponent.componentAttributes.btnWidth='46';myExportComponent.componentAttributes.btnHeight='18';myExportComponent.componentAttributes.btnColor='E1f5ff';myExportComponent.componentAttributes.btnBorderColor='0372AB';//ButtonfontpropertiesmyExportComponent.componentAttributes.btnFontFace='Verdana';myExportComponent.componentAttributes.btnFontColor='0372AB';myExportComponent.componentAttributes.btnFontSize='13';//TitleofbuttonmyExportComponent.componentAttributes.btnsavetitle='出图'myExportComponent.componentAttributes.btndisabledtitle='出图';//RendertheexporterSWFinourDIVdivOutmyExportComponent.Render("divOut");}//全屏functionshowFullPage(){window.open('<%=Page.ResolveClientUrl("~/")%>HBManager/ComInfo/Pie.aspx?IsFullPage=Y&FS=<%=FS%>&YS=<%=YS%>');}vargroupboxFlag=0;functionMyGroupBox(imgBase,tabBase){GroupBox(imgBase,tabBase);varsearchHeight=document.getElementById('divSearch').offsetHeight+5;document.getElementById("DivMapWinInfo").style.height=h-searchHeight+"px";//myChart.resizeTo("100%","550");if(groupboxFlag==0){groupboxFlag=1;}else{groupboxFlag=0;}if(groupboxFlag==1){document.getElementById("divPrint").style.top="41px";document.getElementById("divPrint").style.right="100px";document.getElementById("divFull").style.top="41px";document.getElementById("divFull").style.right="46px";}else{document.getElementById("divPrint").style.top="111px";document.getElementById("divPrint").style.right="100px";document.getElementById("divFull").style.top="111px";document.getElementById("divFull").style.right="46px";}}</script></asp:Content>
解决方案
解决方案二:
varmyChart=newFusionCharts("FusionCharts/Column3D.swf","testCharViewId",'80%','95%',"0","0","FFFFFF","exactFit");在创建时用exactFit属性就行了。找的别人的回复,你自己试试。
解决方案三:
引用1楼yue547283947的回复:
varmyChart=newFusionCharts("FusionCharts/Column3D.swf","testCharViewId",'80%','95%',"0","0","FFFFFF","exactFit");在创建时用exactFit属性就行了。找的别人的回复,你自己试试。
这种方式先前试过不行。
解决方案四:
没用过该控件,帮顶下