asmi

Fusion Charts API- free?

Recommended Posts

Hi all,

 

I am completely new to Fusion Charts and want to use it for generating interactive reports. I have downloaded a zip from the net called fusioncharts_src.zip from http://www.davidlai101.com/blog/index.php/2009/04/30/fusionchartsjava

 

This has some examples and classes like ChartFactory.java, ChartType.java, FusionGraph.java and also some script files. Using this, I am able to deploy a simple pieChart. Now my question is that to make use of this in my project, are these the only classes and API Fusion Charts provides and we have to make use of it as needed- or do we need to purchase it so as to get access to the entire Fusion Charts API. Please guide me in this so that I can start exploring this tool. Thanks in advance.

Share this post


Link to post
Share on other sites

Hi Asmi,

Welcome to FusionCharts And JSP!

Currently, FusionCharts only provides a wrapper to use with JSP, a set of classes for easy usage and an exporter jar for exporting charts as images - there is no official Java FusionCharts API released yet.

To use FusionCharts in JSP, please download the package from FusionCharts website. There are examples with documentation, that come along with the download package. You could easily start off from there.

Hope this helps!

Srividya :)

Edited by Guest

Share this post


Link to post
Share on other sites

Thankyou Srividya! This really helped me to get going. I have downloaded the FusionCharts V3 package.

 

I have generated a chart and trying to Export it to pdf. I went through the documentation and followed all steps mentioned there. But there the code uses xml files- SimpleExample.xml- and uses it as a parameter for generating the chart.

 

From what I had downloaded previously, there was an example to generate the xml string on the fly- I did not have to create the xml file. The xml string was generated depending on the parameters set and the chart was displayed accordingly. So it is the same chart that I am using here. Now the problem is that the chart is rendering properly without any trouble. But when I right click on it I do not see the "Save As" options. Also the button which should be displayed down- the ExportControllerButton- is only being diaplayed as "Loading" which continuously flickers. The embed tag in the chart rendered looks like this:

 

 

 

 

 

< id="columnChart" width="600" height="300" flashvars="chartWidth=600&chartHeight=300&debugMode=0&DOMId=columnChart&registerWithJS=1&scaleMode=noScale〈=EN&dataXML=chart exportEnabled='1' exportHandler='fcExporter1' exportAtClient='1' bgcolor='FF0000'>" allowscriptaccess="always" quality="high" name="columnChart" src="/FusionChartTest/Charts/MSCOLUMN3D.swf" type="application/x-shockwave-flash"/>

 

 

 

 

 

I am not getting where the problem is. :)

 

I have one more question- when the chart is displayed, there is a InfoSoft logo displayed. So how can I get rid of this?

 

Can you please help me out.

Edited by Guest

Share this post


Link to post
Share on other sites

Hello Asmi,

 

 

 

The FusionCharts logo will appear as long as you are using the evaluation version of FusionCharts.

 

 

 

When you buy a license you will be provided with new SWF files which will be exactly similar, only minus the logo.

 

 

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Thanks for that Saptarshi- now I know what exactly I need to do :)

 

 

 

Now regarding the implementation of "export" feature of fusion charts- as I mentioned earlier. I monitored the generated html through Firebug- the data xml string gets generated and it looks like this:

 

 

 

dataXML=

 

< chart exportEnabled='1' exportHandler='fcExporter1' exportAtClient='1' bgcolor='FF0000'>

 

< categories>

 

< category label='Alex'/>

 

< category label='Mark'/>

 

< /categories>

 

< dataset seriesName='Bar Graph' color='FFFFFF' renderAs='BAR'>

 

< set value='25000'/>

 

< set value='35000'/>

 

< /dataset>

 

< styles>< definition/>< application/>< /styles>< /chart>

 

 

 

whereas if I give a data URL, it looks like this:

 

dataURL=SimpleExample.xml"

 

 

 

and SimpleExample.xml is like this:

 

 

 

< chart yAxisName='Sales Figure' caption='Top 5 Sales Person' numberPrefix='$' useRoundEdges='1' bgColor='FFFFFF,FFFFFF' showBorder='0' exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1'>

 

< set label='Alex' value='25000' />

 

< set label='Mark' value='35000' />

 

< /chart>

 

 

 

 

 

I tried modifying the SimpleExample.xml file as the data xml as in the first case- which gets generated- but in this case no chart is displayed- It says no data available :)

 

 

 

Please help me out with this as my application needs a dynamic xml to be generated and not a static file.

Share this post


Link to post
Share on other sites

Hi,

 

 

 

Could you please let us know which chart you are using (SWF name)?

 

 

 

1. In dataXML string, the XML you are using a Multiseries chart's XML. and in dataURL (SimpleExample.xml ) it is a single series chart's XML.

 

 

 

You would need to change the chart's SWF name accordingly to work with it.

Share this post


Link to post
Share on other sites

Thanks a lot Saptarshi- I realised that now. I was earlier using the Column3D.swf which I have now changed to Column2D.swf- the UI changed- it was much pleasing earlier- but wow.... it works!! I tried to find out the difference between single series and multiseries. Apart from the xml format and UI, is there no other difference in them? If that is the case- I would rather prefer using the Column3D.swf. But then is there no way to export it to pdf or save as an image? Please let me know if I am missing out on anything.

 

 

 

Another question-The rendered chart works well on IE- I am able to save the file. But there seems to be an issue with Firefox. The "FCExporter.swf" does not show properly. I only get to see a flickering image of "Loading". While finding a solution to this, a forum suggested that the target div id should be unique. I have reconfirmed the same. Also there are not comments in the Error Console. The code looks like this:

 

 

 

< embed id="fcExporter1" width="400" height="60" flashvars="chartWidth=0&chartHeight=0&debugMode=0&DOMId=fcExporter1&registerWithJS=0&scaleMode=noScale〈=EN&width=400&height=60&bgColor=cccccc&modalExport=0&strictTrigger=0&borderThickness=2&borderColor=0372AB&generator=FusionChartsExportComponent" bgcolor="cccccc" allowscriptaccess="always" quality="high" name="fcExporter1" src="/FusionChartTest/Charts/FCExporter.swf" type="application/x-shockwave-flash"/>

 

 

 

Can you please help me out with:

 

1: Export of multiseries xml data

 

2: Firefox issue.

 

 

 

 

 

dom

Share this post


Link to post
Share on other sites

Hello Asmi,

 

 

 

The fundamental difference between a single series and a multi series data is the number of data sets. You can check out two chart examples:

 

 

 

Single series:http://www.fusioncharts.com/Gallery/Chart.asp?column3d_3

 

Multi Series:http://www.fusioncharts.com/Gallery/Chart.asp?mscolumn3d_1

 

 

 

Also, in your charts could you please try setting RegisterWithJS to one?

 

 

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Got the difference!

 

 

 

About the RegisterWithJS property, I tried setting it to 1, but not sure what the constructor for "FusionChartsExportObject" looks like. I tried setting it in the order I set for FusionCharts like:

 

 

 

new FusionChartsExportObject("fcExporter1", "/FusionChartTest/Charts/FCExporter.swf", "10", "10", "0", "1");

 

But here it gives me an error of "Flash player not installed."

 

Can you please tell me the parameters for this constructor. Also is there any API guide for using the Fusion Charts API?

 

 

 

Now my next step is exporting these charts to powerpoint. I know Fusion Charts does not support this so I was looking for a workaround. Can you tell me if the .swf file with the data loaded gets saved in the same location from where it was being referred to? I am a little confused about the behavior since I tried opening the file on my machine and it opens properly- but if I try to open the same file from another machine it gives an error. Can you please briefly explain me what exactly happens when the chart is generated and how can I access the same .swf object again?

Share this post


Link to post
Share on other sites

Hello Asmi,

 

 

 

The correct way of setting the registerWithJS flag is while creating a new chart object. Here is an example:

 

 

 

<script type="text/javascript">

 

var chart1 = new FusionCharts("Funnel.swf", "ChId1", "600", "400", "0", "1");

 

chart1.setDataURL("Data.asp");

 

chart1.render("chart1div");

 

</script>

 

 

 

 

 

For a detailed documentation on how to use the FusionCharts API, kindly visit the following link:

 

 

 

http://www.fusioncharts.com/docs/

 

 

 

and check out the section titled 'Chart XML API' in the left hand menu panel. :)

 

 

 

 

 

About the last problem of not being able to open it from another computer, it can be due to the Flash Player Global Settings. To know how to set the Flash Player global setting on a computer, please visit the following link:

 

 

 

http://www.fusioncharts.com/forum/Topic5009-47-1.aspx#bm8077

 

 

 

Hope this helps. :)

Share this post


Link to post
Share on other sites
Guest Rajroop

Hey there,

 

 

 

We've just released a new and free add-in for PowerPoint that lets you add FusionCharts very easily to your slides. Check out oomfo @ http://oomfo.com

 

 

 

Would love to have your feedback/suggestions. :)

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