将fusionchart导出到图像时的空白图像

时间:2011-11-09 09:31:27

标签: c# asp.net fusioncharts

我正在尝试重复here中的示例并重写c#上的代码,但结果我得到一张空白图片。我哪里错了?

        protected void BtnSave_Click(object sender, EventArgs e)
    {
       SWFToImage.ISWFToImageObject swfobj  = new SWFToImage.SWFToImageObject();
            swfobj.InitLibrary("demo", "demo");
            swfobj.InputSWFFileName = Server.MapPath("FusionCharts/") + "MSColumn2D.swf";
       swfobj.ImageOutputType = SWFToImage.TImageOutputType.iotJPG;
       string filenm = Server.MapPath("FusionCharts/" + "MSColumn2D.jpg"); 
swfobj.Execute_Begin();
swfobj.Execute_SetVariable("dataXML", "<chart yAxisName='Sales Figure' caption='Top 5 Sales Person' numberPrefix='$' useRoundEdges='1' bgColor='FFFFFF,FFFFFF' showBorder='0' ><set label='Alex' value='25000'  /><set label='Mark' value='35000' /> <set label='David' value='42300' /><set label='Graham' value='35300' /><set label='John' value='31300' /></chart>");
swfobj.Execute_SetVariable("chartWidth", "750");
swfobj.Execute_SetVariable("chartHeight", "600");
swfobj.ImageWidth = 600;
swfobj.ImageHeight = 500;      
swfobj.Execute_GetImage();
swfobj.SaveToFile(filenm);
swfobj.Execute_End();        

    }

1 个答案:

答案 0 :(得分:0)

你必须错过dataXML中的动画='0',我在帖子中清楚地提到过。另外建议添加

Threading.Thread.Sleep(10000)

之前

swfobj.Execute_GetImage();

由于