Sign in to follow this  
michael.zhang

After I invoke the drill down link, the js method setDataXML stops working

Recommended Posts

I'm using GWT JSNI to wrap up the FusionCharts.js, and that works well for dynamically updating chart by the setDataXML method.

Everything seems good until I add the column drill down link which invokes a javascript method.

The link itself also works fine,

but after I click on the column link (which goes to somewhere else) and when I go back to the chart page,

the setDataXML method doesn't work anymore.

I'm using IE7 which gives a error: "Object doesn't suport this property or method".

Did anyone experience any problem similar?

The way we wrap up FusionCharts.js,

  private static final class FusionChart extends JavaScriptObject

  {

  public native static FusionChart create(String id, String fileName, String width, String height)

  /*-{

  return new $wnd.FusionCharts("./swf/charts/" + fileName,

  "fc-" + id, width, height, "0", "1", "FFFFFF", "noScale", "EN", "0", "0");

  }-*/;

  protected FusionChart()

  {

  }

  public native void render(String id)

  /*-{

  this.render(id);

  }-*/;

  public native void setDataXML(String dataXml)

  /*-{

  if (dataXml != null)

  {

  this.setDataXML(dataXml);

  }

  else

  {

  this.setDataXML("<chart></chart>");

  }

  }-*/;

  }

Share this post


Link to post
Share on other sites

Hi Srividya,

 

 

 

I tried both j- and javascript: formats. Issue still...

 

 

 

The link itself works fine, and before invoke the link everything is good,

 

 

 

but after click on the column link, the chart stops updating when I change some parameters.

 

 

 

Thanks for your quick reply.

 

 

 

Michael

Edited by Guest

Share this post


Link to post
Share on other sites

Hi Rajroop,

 

 

 

I did set the registerWithJs to 1 (return new $wnd.FusionCharts("./swf/charts/" + fileName, "fc-" + id, width, height, "0", "1", "FFFFFF", "noScale", "EN", "0", "0")), however,

 

 

 

I'm using the FusionCharts.js file shipped with the license (FusionCharts v3.1 Release: 24th February 2009), in the directory: FusionCharts_EnterpriseCodeFusionChartsFusionCharts.js

 

 

 

The FusionCharts.js above is different from the js file used in the FC official site (http://www.fusioncharts.com/Demos/Blueprint/FusionCharts/FusionCharts.js).

 

 

 

The js file comes with license has the constructor:

 

infosoftglobal.FusionCharts = function(swf, id, w, h, debugMode, registerWithJS, c, scaleMode, lang, detectFlashVersion, autoInstallRedirect){...}

 

 

 

The js file from FC site:

 

infosoftglobal.FusionCharts = function(swf, id, w, h, debugMode, registerWithJS, c, scaleMode, lang){...}

 

 

 

There are probably some other minor difference also.

 

 

 

Which one should I use?

Edited by Guest

Share this post


Link to post
Share on other sites

Tried both js files. Either solves the problem.

 

 

 

When I search around, I saw "External interface doesn't work in Internet Explorer unless you're loading the SWF during page load."

 

(http://mihai.bazon.net/blog/flash-s-externalinterface-and-ie)

 

 

 

That might explain why the setDataXML doesn't work when I go back to the chart(which is not loaded during page load).

 

 

 

And, I tried with firefox, it just behaves totally different...

 

 

 

Not sure yet how to fix it in gwt env...

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello,

Instead of hiding the chart, could you please try with setting the chart at an absolute position which is negative to the top or left of the page?

Share this post


Link to post
Share on other sites

Just for ones who try to put together GWT and FusionCharts. Don't!!!!!

 

 

 

Don't do that if you don't want any bizarre or cross-browser issues (which you have to find out in GWT emulator and then reproduce by native javascript/css, and solve/hack it, then implement the idea in GWT/java, test it in GWT emulator, and after that you realize there is no guarantee it works for the browsers).

 

 

 

FusionCharts is a very good charting tool.

 

 

 

Javascript/css is where brings in all the cross-browser problems/bugs.

 

 

 

GWT just squares all the problems you got at the client side (without GWT you probably can solve the problems one by one, browser by brower).

 

 

 

Maybe Flex is a better option...

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Michael,

Thanks for sharing your idea.

Happy FusionCharting. :D

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

 

FusionMaps for Flex is now out of Beta.

 

We are happy to release FusionMaps for Flex v1.0 - animated, interactive and dynamic maps for your Adobe Flex Solutions.

 

FusionMaps for Flex boasts of the following:

 

* Provides over 314 maps including all continents, countries, US states, and states/counties of a lot of other countries.

* Supports dynamic-resizing.

* API for Drill-down, mouse interactivity, export etc.

* Custom Markers, shapes, connector lines.

* Works with Flex Builder 2, Flex Builder 3 and Flash Builder 4 (Flex SDK 2/3/4).

* Simple copy-paste style installation.

* Lots of code samples and extensive documentation.

 

 

You may download the beta from www.fusioncharts.com/flex/download.

 

You may see the online demos at :

www.fusioncharts.com/flex/demos/us-election/index.html or

 

www.fusioncharts.com/flex/demos/us-employment-distribution/index.html.

 

You may see all the map using our interactive Map Explorer.

 

To read more on how to use FusionMaps for Flex, you may also visit the Online Documentation at www.fusioncharts.com/flex/docs/maps.

 

Your feedback is VERY important to us and we would love to hear any suggestions, complaints, modifications, feature requests, compliments etc.

 

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