sirill Report post Posted July 29, 2008 Hi, I am using SWFToImage with C# to capture the swf on jpg files. I try to get a Pie2D with only one element in it. I use this code for setiing the dataXML when the SWF will be launched graph.Execute_SetVariable("dataXML", GraphXml); But i'm facing a problem : If my Pie2D has only one elements i get a data XML invalid message. Here is the XML Code of my chart : <chart bgColor='FFFFFF' showBorder='0' animation='0' use3DLighting='0'><set label='taux' value='100'/> </chart> But if the XML has a second element : <chart bgColor='FFFFFF' showBorder='0' animation='0' use3DLighting='0'><set label='taux' value='100'/><set label='alternatif' value='100'/> </chart> This works this time... Here is the debugger message : Someone got a solution for this ? Thanks Share this post Link to post Share on other sites
Rahul Kumar Report post Posted July 29, 2008 Hi Sirill, Could you please follow these codes: // This will execute the flash. graph.Execute_Begin(); // Now set the dataXML variable. graph.Execute_SetVariable("dataXML", xml);// Important Step. Console. WriteLine("Wait till chart fully load itself."); Console.ReadLine();// Capture the SWF as Image. graph.Execute_GetImage(); // Save the captured Image(Binary) in File.graph.SaveToFile( "FusionCharts.bmp");It works like this: When you invoke graph.SaveToFile() method, it just captures SWF's frame No. 0 or more but not the final frame i.e. when chart completely loads. To overcome this issue you have to wait till chart finished loading itself, for this purpose I have used Console.ReadLine();. However if you don't like to use ReadLine() you can use some delay method. Share this post Link to post Share on other sites
sirill Report post Posted July 30, 2008 Hi, Thanks for your reply. I was actually using a method to wait until the chart completely loads but this is not the purpose of my problem. everything works fine with two elements in my Pie2d Chart but if it only contains one element i get the error you can see on the screenshot. For all other charts swftoimage works fine (I use this to include charts in PDF and everything works fine unless this one element Pie Chart ) Share this post Link to post Share on other sites
Rahul Kumar Report post Posted July 30, 2008 Hi, Could you please send us the code? Share this post Link to post Share on other sites
Rahul Kumar Report post Posted July 30, 2008 Hi, Mail your code to support [at] fusioncharts.com. Share this post Link to post Share on other sites
sirill Report post Posted July 30, 2008 Okay ! It's Done ! Thanks. Share this post Link to post Share on other sites