abbottmw Report post Posted February 1, 2010 I know there arent any CFM export handlers, but I can use the JSP handlers. My question is, is there a way to export a chart behind the scenes, and then only display the PNG or JPG of the chart? I was looking on the forum and didnt see a post on this, but if you know of one, let me know. The charting in coldfusion allows you to specify if you want flash, jpg, png etc output. I was working on doing this same thing with fusion charts. Is there a way to get the swf data from a stream without posting, or right clicking on the chart and doing a "save as..."? Thanks!! -Matthew Share this post Link to post Share on other sites
Guest Madhumita Report post Posted February 2, 2010 (edited) Hello, We have a solution in .NET that exports the chart image server-side without rendering the chart in the browser. I'm afraid, we do not have a solution for this in ColdFusion. What can do is use the chart's native getImageData() function to retrieve chart's bitmap in RLE format. If you need more help on how to transform the bitmap, let us know. You can refer to the following forum post: http://www.fusioncharts.com/forum/Topic18235-28-1.aspx Edited February 2, 2010 by Guest Share this post Link to post Share on other sites
abbottmw Report post Posted February 3, 2010 Is this getImageData() method on the chart javascript object? If, so do i have to render the chart before i can call the image data? Something like below.. how would i use the getImageData() method? var chart1 = new FusionCharts("AngularGauge.swf", "ChId1", "350", "190", "0", "1"); chart1.setDataXML(xml); chart1.render("chart1div"); Share this post Link to post Share on other sites
Guest Madhumita Report post Posted February 4, 2010 Hello, You can call this method after the chart has rendered. If FC_Rendered event is fired then getChartFromId('ChId1').getImageData() will fetch the data. ref. - http://www.fusioncharts.com/widgets/docs/Contents/JS_Events.html I hope this helps you. Share this post Link to post Share on other sites
abbottmw Report post Posted February 4, 2010 So are you saying i have to render the flash chart on the page, then get that chart from its id, and get the image data? I didnt want to render the flash chart on the page, i wanted to do that all behind the scenes. can render() be called without passing something to it? Share this post Link to post Share on other sites
abbottmw Report post Posted February 4, 2010 Im getting an error when i try to do this. What am i doing wrong? At the top of the page i have this. <script> function FC_Rendered(DOMId) { var x = getChartFromId(DOMId).getImageData(); alert(x); } </script> Lower down the page i have this: <script type="text/javascript"> var chart1 = new FusionCharts("AngularGauge.swf", "ChId1", "350", "190", "0", "1"); chart1.setDataXML("#xml#"); chart1.render("chart1div"); </script> x alerts as underfined. can i not alert x? Share this post Link to post Share on other sites
Guest Madhumita Report post Posted February 4, 2010 Hello, You call the method after the FC_Rendered is fired. Share this post Link to post Share on other sites
abbottmw Report post Posted February 5, 2010 Could you by chance send me an example? I still am missing something, and cant get it to work. Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted February 8, 2010 Hi, Please refer to the sample code below:- Ref.- <SCRIPT LANGUAGE="JavaScript"> //FC_Rendered method is called whenever a FusionCharts chart on the page //has finished initial rendering. To this function, the chart passes its //own DOM Id. function FC_Rendered(DOMId){ //If it's our required chart if (DOMId=="chart1Id"){ //Simply alert window.alert("Look Ma! I am Column3D and I've finished loading and rendering."); return; } } </SCRIPT> Also, please refer to the examples mentioned in the JavaScript folder of the Trial pack of the FusionCharts. Ref.- FusionCharts_Evaluation>Code>JavaScript Hope this helps. Share this post Link to post Share on other sites
sun123 Report post Posted September 2, 2014 function FC_Rendered(DOMId) { alert ( DOMId + " chart has been rendered." ); var chartObject = getChartFromId(DOMId); var imageData = chartObject.getImageData() alert("imageData " + imageData) } I am getting chart rendered and Event "FC_Rendered" is getting triggered. I am getting alert first alert "mychartId chart has been rendered. ". Second alert is "imageData undefined". getImageData() method is not returning imagedata. Please can anyone give me working part of code to get image data in Javascript. Thanks in advance Share this post Link to post Share on other sites