Sign in to follow this  
hadyan

Automatic Fallback To Javascript Charts Not Working

Recommended Posts

Hi,

 

I have just upgraded from FusionCharts v3.2 to 3.2.2, and if I understand the documentation correctly, I suppose the fallback to javascript should happen automatically, without any change of code, when no flash is detected (from this doc). Is that correct?

 

This automatic fallback feature doesn't seem to work, even after clearing all the browser's cache. The one without flash just stuck at "Loading chart. Please wait"... (screen capture: post-9454-0-72691800-1323314817_thumb.jpg). Do I miss any step in the upgrade process?

 

Thanks in advance for your support.

 

Regards,

 

Hadyan

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

Could you please confirm the Browser version and operating system you are using?

 

Awaiting for your response.

Share this post


Link to post
Share on other sites

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

Could you please confirm the Browser version and operating system you are using?

 

Awaiting for your response.

 

 

Thanks for the prompt reply. I've tried with FF 5.0 under Redhat. Also tried in IE 7 under Win XP SP 3 by disabling the "Shockwave Flash Object" add-on.

Edited by hadyan

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

Please find the latest SR1 beta JS files attached for your reference.

 

You would need to copy these JS files in your charts folder.

 

Hope this helps.

FusionChartsSR1-beta2.zip

Share this post


Link to post
Share on other sites

Thanks for the files. I've tried replacing the JS files with the ones you attached but it still didn't work. Comparing against my original FusionCharts.js, apparently the one I have is newer (3.2.2-servicerelease1.4200), so i guess those js files are not the source of the problem...

 

Then I tried on a page with much simpler javascripts (i.e.: no prototype/jquery) and the auto switch to javascript charts seems to work well.

 

Not so sure yet, but perhaps some js conflict is breaking the js charts then..? Is there any known conflict with any js libraries?

 

Thanks.

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

Could you please confirm whether you are rendering the chart from local file system or server?

 

JavaScript charts use AJAX to load data from the URL data sources. Some browsers does not allow AJAX data loading to function when running from local file system (using file:/// protocol). Hence, when you run the JavaScript charts from local file system and you are using Data URL method (setXMLUrl, setJSONUrl, setDataURL or similar functions) to provide data to charts where physical xml or json files are involved, this error occurs.

 

To over-come this situation, you would need to render the JavaScript charts using Data String method.

 

For more details about Data String method, please visit : http://docs.fusionch...rt/DataXML.html

 

Hope this helps.

Share this post


Link to post
Share on other sites

I'm having the same issue with XT 3.2.2 SR1 .. forcing it to use javascript works fine in 3.2.2 .. except that I needed to force for the MSStackedColumn2D chart which was not available in 3.2.2. If I use 3.2.2 charts display fine forcing javascript. If I use 3.2.2 SR1 none of them do. I'm not running on a local file system. Here is how I'm calling the charts:

 

var URL = "http://.../empreqshifts.php?client="+client+"&hospital="+hospital;

 

URL = escape(URL)

 

</script>

</head>

 

<body bgcolor="#ffffff">

<div id="chartdiv">

The chart will appear within this DIV. This text will be replaced by the chart.

</div>

<script type="text/javascript">

FusionCharts.setCurrentRenderer('javascript');

var myChart = new FusionCharts("http://.../fusion/charts32/MSCombi2D.swf", "myChartId", "1175", "425", "0", "0");

myChart.setDataURL(URL);

myChart.setTransparent(true);

myChart.render("chartdiv");

</script>

</body>

 

 

u reference in this post using the setDataURL does not work using a local file system .. I'm accessing on a server. If i display as Flash they display fine .. if I force javascript .. all I get is "Loading chart. Please wait"

Edited by rmortensen

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your post.

 

For rendering JavaScript charts, FusionCharts makes use of FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js. These files are present in Charts folder of the Download Pack.

 

Please make sure you have these files in your charts folder along with FusionCharts.js and you have provided correct path of FusionCharts.js in your HTML code.

 

Hope this helps.

Share this post


Link to post
Share on other sites

I have the same problem with this code:

 

FusionCharts.setCurrentRenderer('javascript');

chart = new FusionCharts(base_url + "js/fusioncharts/Charts/MSLine.swf", "ChartId", "800", "400", "0", "0");

chart.setXMLUrl(base_url + "js/fusioncharts/Charts/Data.xml");

chart.render("chartDiv");

 

As soon as I remove the setCurrentRenderer call, it works fine (as a flash chart).

 

Firebug gives this error: "NetworkError: 404 Not Found - http://localhost/XXXXXXX/http%3A%2F%2Flocalhost%2FXXXXXXX%2Fjs%2Ffusioncharts%2FCharts%2FFusionCharts.HC.js",

so apparently the path to the js file gets broken somewhere in the process

 

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

You seems to be using Data URL method (provide data to chart from files or streams) to provide chart data. Many browsers restrict JavaScript from accessing local file system owing to security reasons. The JavaScript charts, when running locally, would not be able to access data provided as a URL. If you run the files from a server, it will run absolutely fine, as the data is then read and streamed by the server, without the need for JavaScript to directly access local filesystem. When running locally, however, if you provide the data as string (using the Data String method), it works fine.

 

Hope this helps.

Share this post


Link to post
Share on other sites

I have the same problem with this code:

 

FusionCharts.setCurrentRenderer('javascript');

chart = new FusionCharts(base_url + "js/fusioncharts/Charts/MSLine.swf", "ChartId", "800", "400", "0", "0");

chart.setXMLUrl(base_url + "js/fusioncharts/Charts/Data.xml");

chart.render("chartDiv");

 

As soon as I remove the setCurrentRenderer call, it works fine (as a flash chart).

 

Firebug gives this error: "NetworkError: 404 Not Found - http://localhost/XXXXXXX/http%3A%2F%2Flocalhost%2FXXXXXXX%2Fjs%2Ffusioncharts%2FCharts%2FFusionCharts.HC.js",

so apparently the path to the js file gets broken somewhere in the process

 

 

Strangely enough, the problem lied in how FusionCharts.js was called in the header. I changed the path to the js file to be relative like this:

<script type="text/javascript" charset="utf-8" src="js/fusioncharts/Charts/FusionCharts.js"></script>

 

Hope this helps others as well.

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thank you very much for your valuable feedback.

 

We are glad to know that you have managed to resolve your problem.

 

Happy 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
Sign in to follow this