voodoonet Report post Posted October 19, 2009 (edited) Hello, I am trying to use for the first time fusion chart, but getting this error: Message : 'null' has null value or is not an object Line : 250 Character : 5 Code : 0 URI : http://intranet/FusionCharts/JSClass/FusionCharts.js here is my code: <link rel="stylesheet" href="FusionCharts/Contents/Style.css" type="text/css" /> <script language="JavaScript" src="FusionCharts/JSClass/FusionCharts.js"></script> </head> <body> <script language="JavaScript" type="text/JavaScript"> <!-- function showdiv(Did){ //alert(Did); var maDiv = document.getElementById(Did) if(maDiv.style.display == 'none'){ maDiv.style.display = 'block'; } else{ maDiv.style.display = 'none'; } } //--> </script> <link rel="stylesheet" href="modules/Actionplan/stylesheets/default.css" type="text/css" /> <div id="columns"> <ul id="column1" class="column"> <li class="widget color-green"> <div class="widget-head"> <h3>Introduction </h3> </div> <div class="widget-content"> <p>'._WidgetIntro.' <script type="text/javascript"> var chart = new FusionCharts("FusionCharts/Charts/Column2D.swf", "ChartId", "500", "300", "0", "0"); chart.setDataURL("FusionCharts/Gallery/Data/Column2D.xml"); chart.render("chartdiv"); </script></p> </div> Any idea? Edited October 19, 2009 by Guest Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted October 19, 2009 Hi, You need to write this code chart.render("chartdiv") inside your HTML codes and the chartdiv(which is a 'div id') should not enclose any script. For example: <div id="chartdiv" align="center"> FusionCharts. </div> Hope this helps. Share this post Link to post Share on other sites
voodoonet Report post Posted October 19, 2009 same error with this: <code> echo' <script type="text/javascript"> var chart = new FusionCharts("FusionCharts/Charts/Column2D.swf", "ChartId", "500", "300", "0", "0"); chart.setDataURL("FusionCharts/Gallery/Data/Column2D.xml"); chart.render("chartdiv") </script> <div id="Help" style="display:none"><img src="modules/actionplan/pnimages/AidePA-fra.png"></help></div> <div id="mygantt" style="display:none"> <IMG SRC="modules/actionplan/mygantt.php?uid='.$userid.'&site='.$site.'〈='.$lang.'"></div> <div id="columns"> <ul id="column1" class="column"> <li class="widget color-green"> <div class="widget-head"> <h3>Introduction </h3> </div> <div class="widget-content"> <p>'._WidgetIntro.' <div id="chartdiv" align="center"></div></p> </div> </code> Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted October 20, 2009 Hi, Could you please have a look to the following link as it contains the solution for similar kind of issue? Ref:-http://www.fusioncharts.com/forum/Topic19306-28-1.aspx Hope this helps. Share this post Link to post Share on other sites
voodoonet Report post Posted October 20, 2009 (edited) well you are refering to my post.??? :hehe: Edited October 20, 2009 by Guest Share this post Link to post Share on other sites
voodoonet Report post Posted October 20, 2009 Does anyone had similar troubles? Share this post Link to post Share on other sites
Guest Basundhara Ghosal Report post Posted October 21, 2009 Hi, We apologize for the inconvenience caused. Could you please send us the XML code that you are using as an attachment so that we might look into it? Awaiting your reply. :hehe: Share this post Link to post Share on other sites
voodoonet Report post Posted October 21, 2009 I do not think the xml is the problem as the error comes in loading the js file and i am using the xml provided in the data folder... Share this post Link to post Share on other sites
FusionCharts Support Report post Posted October 22, 2009 Hi, To start with your issue: Hello, I am trying to use for the first time fusion chart, but getting this error: Message : 'null' has null value or is not an object Line : 250 Character : 5 Code : 0 URI : http://intranet/FusionCharts/JSClass/FusionCharts.js here is my code: <link rel="stylesheet" href="FusionCharts/Contents/Style.css" type="text/css" /> <script language="JavaScript" src="FusionCharts/JSClass/FusionCharts.js"></script> </head> <body> <script language="JavaScript" type="text/JavaScript"> <!-- function showdiv(Did){ //alert(Did); var maDiv = document.getElementById(Did) if(maDiv.style.display == 'none'){ maDiv.style.display = 'block'; } else{ maDiv.style.display = 'none'; } } //--> </script> <link rel="stylesheet" href="modules/Actionplan/stylesheets/default.css" type="text/css" /> <div id="columns"> <ul id="column1" class="column"> <li class="widget color-green"> <div class="widget-head"> <h3>Introduction </h3> </div> <div class="widget-content"> <p>'._WidgetIntro.' <script type="text/javascript"> var chart = new FusionCharts("FusionCharts/Charts/Column2D.swf", "ChartId", "500", "300", "0", "0"); chart.setDataURL("FusionCharts/Gallery/Data/Column2D.xml"); chart.render("chartdiv"); </script></p> </div> It seems that you have NOT defined any of the DIVs with ID value "chartdiv". Could you please confirm that you have a DIV with with "chartdiv"? The line :chart.render("chartdiv"); says that the chart will be rendered in a DIV having id - "chartudiv". But it seems that there is no such div. So, the renedering engine is unable to locate the DIV and hence unlocated refence is rseulted as 'null'. Please define a DIV with id="chartdiv". Share this post Link to post Share on other sites