Sign in to follow this  
newbie@fusion

'FusionCharts' is undefined -- javascript error in IE

Recommended Posts

hello

I am using the "new FusionCharts()" method from FusionCharts.js file to create 5 fusion charts ( 4 HLinearGuage and 1 Angular Guage).

I am using the portlet techonology (Liferay Portal) and testing in IE6 and Firefox, version 1.2 of FusionCharts.js

The charts and form submit works fine on FIrefox.

However on IE, I am getting a JS error " 'FusionCharts' is undefined " error. Also the charts don't render at startup, only shows 4 "Chart" text lines. To load them I have to refresh the portlet. On refresh I can see the charts correctly however the JS error still shows at the bottom of IE due to which the form submit does not work.

Below is the code snippet(only including the relevant section), please look into the problem.

<html>

</head>

<script type="text/javascript" src="/html/portlet/ext/vote/FusionCharts.js" ></script>

<SCRIPT LANGUAGE="JavaScript">

function FC_Rendered(DOMId){

// logic for rendering the 5 charts as specified in examples

}

</SCRIPT>

</head>

<form action.......> </form>

<table>

<tr>

<td width="0">

<div id="chart22div">Chart</div>

<script type="text/javascript">

var myChart2 = new FusionCharts("/flash/HLinearGauge.swf", "ChId2", "280", "55", "0", "1");

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

myChart2.render("chart22div");

</script>

</td>

//similarly for other 4 charts

</html>

post-2115-128441566262_thumb.jpg

Share this post


Link to post
Share on other sites

Hi

 

 

 

i have the same error but i resolve when i include the "FusionCharts.js" verify that the "url" o "src" to the FusionCharts.js

 

is ok...

 

 

 

in my case i put this in my JSP:

 

 

 

 

 

 

and i can render the chart..

 

 

 

Saludos.

 

 

 

Pablo.

Share this post


Link to post
Share on other sites

Hi,

It seems that the FusionCharts.js is not getting fully loaded when the process of rendering the chart is executed. FusionCharts is undeinfed error occurs only when the full class file is not loaded or not present. That it is present but not fully loaded is proved by the fact that on refresh the chart loads, as now the JS is loaded from cache quickly.

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