MrFast

Client Side JavaScript Charting error

Recommended Posts

Hello!

I am very excited about the JavaScript/AJAX-like capabilities of your chart products.;)

But, I have a problem in our requirements, and a JavaScript error in the client side updates of the charts.

I have placed the swf-files in a different sub-domain/domain then the web-pages which renders the charts. Acording to the licensing, this should be possible, right?

When I do, here is what I get:

- First time around (when the page loads), all charts are rendered perfecly.

- After first page load, calling the setDataXML throws a JavaScript error.

(see attachment)

To make it easy for you to reproduce just add a domain in your demo at http://www.fusioncharts.com/Demos/JS/Index.html :

 

 //any sub-domain or domain added here gives the error next time the user calls setDataXML;

 var gc_swf_path = "http://charts.backbone.se/swf/"; 

 var chart1 = new FusionCharts(gc_swf_path + "MSColumn3D.swf", "chart1Id", "600", "400", "0", "1");

 //Initialize chart with empty data. We'll feed it data on the chart's FC_Rendered event.

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

 chart1.render("chart1div");

 

Is there a workaround or fix?

 

I can fix the JavaScript, if you point me in the right direction.

 

Some background notes which might be of interest:

We have multiple sites running our crm-application. I would rather not have to distribute the JavaScript and the swf files to all sites, some of them behind firewalls. I would like to give our clients nice charts, no matter what server they are running our application from. At the same time I want control of how the chart components are used, from what domains, etc.

I want our clients to use our interface to your components (as a backend). I don't want to give them full access to your components, just because I need to include them under their website. I am sure that is in your interest too.

Kind regards,

/Hans

post-663-128441564203_thumb.jpg

Share this post


Link to post
Share on other sites

You can build a proxy page on your server, which actually gets the data from remote page and then conveys it locally to the chart.

 

 

 

For example:

 

 

 

Chart --> Your proxy page --> Remote server --> back to your proxy page --> Chart.

Share this post


Link to post
Share on other sites

Hi - Is it possible that this crossdomain error would apply with Fusion Charts 3 but not with the free version. I'm only having this issue with the new version, but maybe that's because it is written with the more recent version of Action Script?

 

 

 

Thanks

Share this post


Link to post
Share on other sites

Hi,

 

 

 

It could be because of that - however, I'm not really sure. But FusionCharts Free is in AS1 and FusionCharts v3 in AS2.

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