Boasoft Report post Posted October 2, 2009 Hi, I have FusionChart with gif defined in bgSWF parameter. The gif is very small (1050 bytes). I use automatic export to JPG by calling following JavaScript functions: function FC_Rendered(DomID) { chartObjects[DomID] = getChartFromId(DomID); intervlId[DomID] = setInterval(function() {CheckRender(DomID);}, 10); }; function CheckRender(DomID) { //If this Properties are True that means the Chart Became Updated if(chartObjects[DomID] && chartObjects[DomID].hasRendered && chartObjects[DomID].hasRendered()){ window.clearInterval(intervlId[DomID]); //exporting the chart chartObjects[DomID].exportChart({exportFileName: '/files/'+JPGfile[(DomID.charAt((DomID.length)-1))-1] }); // ( { exportAtClient: '1'} ) } }; The code itself was provided in this forum by one of FS developer in the past. The problem is that the background file is not visible in exported JPG. It can be seen that the background appears a bit after the chart is rendered and therefore export procedure triggerred by FC_Rendered does not "see" the background image yet. The same problem occurs when animation=1 is set - FC_rendered is trigerred too early and sometimes instead of lines (in case of e.g. ScrollArea2D.swf) exported JPG contains anchors only (as lines have rendered several hundred miliseconds after FC_Rendered was fired). Do you know how to fix this issue? How to ensure that exportChart fired after FC_Rendered will always contain full screenshot? Is it possible for you to delay trigger of FC_Rendered a bit? Regards, Boasoft. Share this post Link to post Share on other sites
Ayan Pal Report post Posted October 5, 2009 hi, FC_Rendered() function is called when the chart is rendered.but if you set animation=1 then animation takes some times after the chart has rendered. As you called the export function after the chart is rendered so its export the chart before the chart's animation is completed. to solv this you can use a time delay by using setTimeout(). the code may be as follows- function CheckRender(DomID) { //If this Properties are True that means the Chart Became Updated if(chartObjects[DomID] && chartObjects[DomID].hasRendered && chartObjects[DomID].hasRendered()){ window.clearInterval(intervlId[DomID]); //exporting the chart var t=setTimeout("chartObjects[DomID].exportChart({exportFileName: '/files/'+JPGfile[(DomID.charAt((DomID.length)-1))-1] }); // ( { exportAtClient: '1'} )",500) } **adjust the time(500) in ms as per you needed Share this post Link to post Share on other sites
Guest Rajroop Report post Posted October 6, 2009 Hey Ayan, Thank you for your inputs. Share this post Link to post Share on other sites
Boasoft Report post Posted October 6, 2009 Hi, Thanks for suggestion! However, it will not work the way you presented, because of problems with passing DomID to the "inside" of setTimeout. The solution which works is as follows: //exporting the chart var t= function() {chartObjects[DomID].exportChart({exportFileName: '/files/'+JPGfile[(DomID.charAt((DomID.length)-1))-1] });} u=setTimeout(t,500); Problem solved! Share this post Link to post Share on other sites
Guest Rajroop Report post Posted October 6, 2009 Great! Thanks for sharing this on the Forum. Share this post Link to post Share on other sites