Sign in to follow this  
Pallavi

Javascript call from JSNI

Recommended Posts

I'm trying to use some functions from FusionCharts.js using JSNI .

 

Can some one give some short example on it ?

 

Add the following method in your GWT 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 from where you want to embed it.

Please note that I have hardcoded the params here. You would need to put in the chartParams variable instead.

 

In your html, you would have to include FusionCharts.js in the head section.

This code has been tested with SmartGWT.

 

Hope this helps one and all.

Keep FusionCharting!

Srividya

Share this post


Link to post
Share on other sites

I am trying to use Linked Chart with smartgwt i used both swfobject and smartgwt Flashlet as a wrapper however for both i get the same error:

following is a copy from firebug the error is orphan event and it seems that the event manager couldn't find or identify the DOM object your help would be appreciated

please note that every thing work fine for the chart but when i click on link to drill down nothing happen.

<quote>

arguments

["linkedchartinvoked", undefined, Object { linkType="XMLURL", data="DataLoader?data=1&year=2012"}]

 

0 "linkedchartinvoked"

 

1 undefined

 

2 Object { linkType="XMLURL", data="DataLoader?data=1&year=2012"}

 

c undefined

 

d Object { linkType="XMLURL", data="DataLoader?data=1&year=2012"}

 

data "DataLoader?data=1&year=2012"

 

linkType "XMLURL"

 

e "linkedchartinvoked"

</quote>

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