Ravi M

Looking for working GWT + FusionCharts example

Recommended Posts

Hi all

 

 

 

I am a newbie to this forum, to FusionCharts and (alas!) to Javascript. We are trying to use FusionCharts in a GWT application and were hoping to find a simple working example that we could use as a starting point.

 

 

 

This thread -> http://www.fusioncharts.com/forum/Topic11755-28-1.aspx seems to be on the correct lines, but we are facing issues (as posted there already) with getting things working right.

 

 

 

Does anyone have a working example they may be able to share, especially on the magic needed in the GWT client to make a FusionCharts chart show?

 

 

 

Regards

 

Ravi

Share this post


Link to post
Share on other sites

Hi,

 

Currently, I do not have a FusionCharts example with GWT.

However, I can give you guidelines on how it can be integrated.

 

Add the following method in your Canvas class :

public native String embedFusionCharts(String chartParams)/*-{

chart = new $wnd.FusionCharts("FusionCharts/Column3D.swf", "chart1Id", "800", "400", "0", "1");

chart.setDataURL("Data/Data.xml");

chart.render("chartDiv");

}-*/;

 

Just call the above embedFusionCharts method with the required parameters ( Here the values are hard-coded for simplicity sake ) in the constructor of Canvas class.

 

Include FusionCharts.js in the head section of your html page as follows:

<script type="text/javascript" language="javascript" src="FusionCharts/FusionCharts.js"></script>

 

Here are the steps:

 

1. You have a Canvas class say, ChartCanvas.java

2. In this class, you have a native function similar to the one that was provided to you in the previous messsage:

 

public native String embedFusionCharts(String chartParams)/*-{

chart = new $wnd.FusionCharts("FusionCharts/Column3D.swf", "chart1Id", "800", "400", "0", "1");

chart.setDataURL("Data/Data.xml");

chart.render("chartDiv");

}-*/;

3. You set the viewPanel for your EntryPoint class as the ChartCanvas (from step1)

4. You have included FusionCharts.js in your html page.

5. In your html page, you have a div with id chartDiv (the id mentioned in step2)

 

 

I hope this guides you towards a solution.

If any one of you succeeds with this procedure, please post the war file here, so that it can help others.

 

Thanks, :(

Srividya Sharma

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Thank you very much for your precious feedback.

 

Keep FusionCharting!biggrin.gif

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