Sign in to follow this  

'FusionCharts' is undefined -- javascript error in IE

Recommended Posts


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.



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


function FC_Rendered(DOMId){

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




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



<td width="0">

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

<script type="text/javascript">

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





//similarly for other 4 charts



Share this post

Link to post
Share on other sites





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..









Share this post

Link to post
Share on other sites


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