Arni XET

Remote site data

Recommended Posts

I am very pleased with what I have seen today in the example code. I was also pleased at how easy it is to get charts working with data from remote URL's.

 

 

 

I use a Javascript to gather data from our remote sites, but I have no control over the tag and label format of the xml that arrives. Since it is not in the standard format that FusionCharts use, the swfs can't load the data.

 

 

 

I have not been able to figure out a way around this problem. Perhaps you have a method?

 

 

 

I know of only chartObject.setDataXML() and .setDataURL(). The latter has FusionCharts.js send an xmlHttpRequest to the url, receives the xml and then fills the divs. But FusionCharts.js, it seems, does not understand the format from my remote sites. The former uses either direct xml in the argument, or uses an xml data file. But for security resaons javaScript is not allowed to write to the local disk.

 

 

 

So I am puzzled over how to get my xml into FusionCharts.

Share this post


Link to post
Share on other sites

I would suggest :

 

- creating your own XML proxy somewhere on the web ( I mean you issue a request to your server, it goes to the desired site, grabs the XML, re-formats it and streams it to your chart )

 

- do the same thing in Javascript, generate chart XML format by parsing incoming XML in Javascript.

 

 

 

hth

Share this post


Link to post
Share on other sites

Ah, the first makes sense.

 

 

 

I'd like to do it with a local javascript however, so there won't be two servers involved.

 

 

 

So, I should use .setDataXML( "myScript.js"). That will execute the local javascript embedded in the html. Is that correct? The javascript can request the data from the server and write out xml as the chart wants it into a text object, then return the text object.

 

 

 

That sounds like it should work. would you agree?

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