在ASP.Net中导出Fusion图表 [英] Exporting Fusion charts in ASP.Net
本文介绍了在ASP.Net中导出Fusion图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将融合图表导出到图像。我尝试了以下但它正在创建空白图像。但图表绘制得很好。
...................................................................................................... ...... ..
Hi,
How can export fusion charts to an image. I have tried the following but it is creating blank image. But the graph is been plotted well.
……………………………………………………………………………………………..
LiteralClosedDefectsTrend.Text = lGraphXML; // This is graph xml been generated
lFnDownloadGraph(lGraphXML);
void lFnDownloadGraph(string aStrXMLGraph)
{
try
{
SWFToImage.SWFToImageObject lObjswfobj = new SWFToImage.SWFToImageObject();
lObjswfobj.InitLibrary("demo", "demo");
lObjswfobj.InputSWFFileName = Server.MapPath("FusionCharts/") + "FCF_MSColumn3D.swf";
string lStrNeededEtx = "jpg";
string lStrSelectedExtn = "";
if (lStrNeededEtx == "jpg")
{
lObjswfobj.ImageOutputType = TImageOutputType.iotJPG;
lStrSelectedExtn = ".jpg";
}
else
{
if (lStrNeededEtx == "gif")
{
lObjswfobj.ImageOutputType = TImageOutputType.iotGIF;
lStrSelectedExtn = ".gif";
}
else
{
if (lStrNeededEtx == "png")
{
lObjswfobj.ImageOutputType = TImageOutputType.iotPNG;
lStrSelectedExtn = ".png";
}
else
{
if (lStrNeededEtx == "bmp")
{
lObjswfobj.ImageOutputType = TImageOutputType.iotBMP;
lStrSelectedExtn = ".bmp";
}
}
}
}
string lStrFilenm = "FCF_StackedColumn3D" + lStrSelectedExtn;
lObjswfobj.Execute_Begin();
lObjswfobj.Execute_SetVariable("dataXML", aStrXMLGraph);
lObjswfobj.Execute_SetVariable("chartWidth", "750");
lObjswfobj.Execute_SetVariable("chartHeight", "600");
lObjswfobj.ImageWidth = 600;
lObjswfobj.ImageHeight = 500;
lObjswfobj.Execute_GetImage();
string lFilePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
lObjswfobj.SaveToFile(lFilePath + @"\" + lStrFilenm);
lObjswfobj.Execute_End();
//DownloadImage(lStrFilenm);
}
catch (Exception)
{
throw;
}
}
........................................................................... .............................. ..
请给我任何帮助。
……………………………………………………………………………………………..
Any Help on this please.
推荐答案
你好。我解决了你的代码。解决方案是在行lObjswfobj.Execute_GetImage();之前添加这个简单的行。 :
Thread.Sleep(4000);
在C#中的方式是:
SWFToImageObject swfobj = new SWFToImageObject();
swfobj.InitLibrary(demo,demo);
swfobj .InputSWFFileName = Server.MapPath(〜/ bin / ScrollLine2D.swf);
swfobj.ImageOutputType = TImageOutputType.iotJPG;
swfobj.Execute_Begin();
swfobj.Execute_SetVariable(dataXML,aStrXMLGraph);
swfobj.Execute_SetVariable(chartWidth,650);
swfobj.Execute_SetVariable( chartHeight,450);
swfobj.ImageWidth = 650;
swfobj.ImageHeight = 450;
Thread.Sleep(4000 );
swfobj.Execute_GetImage();
如果这种方式不适合你...你应该测试添加更多毫秒。
问候
hello. I resolved your code. The solution is add this simple line before line "lObjswfobj.Execute_GetImage();" :
Thread.Sleep(4000);
In C# the way is:
SWFToImageObject swfobj = new SWFToImageObject();
swfobj.InitLibrary("demo", "demo");
swfobj.InputSWFFileName = Server.MapPath("~/bin/ScrollLine2D.swf");
swfobj.ImageOutputType = TImageOutputType.iotJPG;
swfobj.Execute_Begin();
swfobj.Execute_SetVariable("dataXML", aStrXMLGraph);
swfobj.Execute_SetVariable("chartWidth", "650");
swfobj.Execute_SetVariable("chartHeight", "450");
swfobj.ImageWidth = 650;
swfobj.ImageHeight = 450;
Thread.Sleep(4000);
swfobj.Execute_GetImage();
if this way not working for you... you should test add more milliseconds.
Regards
这篇关于在ASP.Net中导出Fusion图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文