Sign in to follow this  

Identifying the chart control(in the form with runat server) in javascript

Recommended Posts


  I am using the column3d chart in the web page which was kept in the form(with runat server) tag.But when i am running this it is showing the javscript error that the chartid is undefined.

Eventhough i tried for identifying the chartid using the document.getElementById it is identifying the chart and after that i used chartid.setDataURL(url).but it is showing another error that that the object doesnt support this method.

Please could you tell me the solution regarding this? and also could you tell me regarding the issue?

Thanks and Regards,


Share this post

Link to post
Share on other sites

You need to necessarily keep the chart outside <FORM> element.

When a Flash object is placed inside <FORM> element, the browser DOM cannot access it.

Share this post

Link to post
Share on other sites

and that means that your charts CAN'T be used in dinamically ASP.NET applications?? (using normar development methods)

that is strange... and not let to use your software for any development

Share this post

Link to post
Share on other sites

hi all,

FusionCharts is fully compatible with ASP.NET irrespective of <FORM> tag. Adobe has already declared that in IE there is some problem connecting  Flash component (externalinterface) with HTML's Javascript if put inside FORM. But where there's a will there's a way.

I have developed some samples (using ASP.NET 2.0 VB/C# and ASP.NET 2.0 AJAX too) of FusionCharts similar to all the Basic samples given in FusionCharts package where there is option to identify chart and chage data dynamically using setDataURL and setDataXML. Actually i have done no extra thing, but just changed the language from ASP to VB and C#.


If you are somehow facing problems identifying the chart add one javascript after the chat is rendered..(this is recommended by Adobe).. 



  window[chartId]=document.getElementById(chartId); //or else document.forms[formName/formIndex][chartId]


This will help you to identify the chart...

You can chage the getChartFromId() in FusionCharts.js too...

infosoftglobal.FusionChartsUtil.getChartObject = function(id)


//  if (window.document[id]) {

// return window.document[id];

//  }

  if (navigator.appName.indexOf("Microsoft Internet")==-1) {

  if (document.embeds && document.embeds[id])

  return document.embeds[id];

  } else {

  return document.getElementById(id);



this worked in IE 6/7, Firefox, Opera 9...i have no morebrowsers installed but will surely check in Safari soon..

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