Sign in to follow this  
abbottmw

ExportHandlers

Recommended Posts

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

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 by Guest

Share this post


Link to post
Share on other sites

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

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

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 Basundhara Ghosal

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. :D

Share this post


Link to post
Share on other sites
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this