ASP.NET Ajax UpdatePanel
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


««12

ASP.NET Ajax UpdatePanel Expand / Collapse
Author
Message
Posted 10/15/2007 1:10:50 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 8:31:36 AM
Posts: 763, Visits: 1,214
Hi everybody,
Please stop fighting over the issue of implementing FusionCharts on ASP.NET AJAX...because fighting only leads us away from being codicated...from real challange of development.

What i have figured out trying to implement FusionCharts in ASP.NET as well as AJAX that the only thing that is hampering the implementation is the mal-treatment of FlashObjects inside <FORMS> (which should be present in ASP.NET pages eventually for UpdatePanel controls)...
From JavaScript's (as AJAX is 80-90% JavaScript)point of view in IE ids inside <form>s are not declared as window[id] but as document.forms[index][id]....hence poor IE cant recognize the obejct .... you may refer to the documentation and way outs (where there's a will there's a way) published by Adobe regarding this... http://kb.adobe.com/selfservice/viewContent.do?externalId=kb400730&sliceId=1

TIP 1: If one is using registerWithJS, after rendering a chart one must use this :

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

Using all resouces i have easily, simply and successfully implemented FusionCharts in ASP.NET AJAX and can change chart data using setDataXML/setDataURL...

oh! 1 thing i missed ... i have modified getChartFromId in FusionCharts.js thus :

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 more browsers installed but will surely check in Safari soon..



Regards,

Sudipto Choudhury
FusionCharts Team
Post #2711
Posted 10/31/2007 3:58:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/21/2008 6:02:11 AM
Posts: 3, Visits: 16
Thanks for your help on this but how do I implement your Tip #1?

Where do I put this javascript?

TIP 1: If one is using registerWithJS, after rendering a chart one must use this :

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

thanks

Post #2909
Posted 10/31/2007 6:16:32 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 8:31:36 AM
Posts: 763, Visits: 1,214
Hi,

some where you are using the fusionCharts javascript embedding method...i.e.

var c1=new FusionCharts(..,"mapID1",..);

c1.setDataURL(...) or c1.setDataXML(...);

c1.render(divID);

if(!document.embeds["mapID1"])
      window["mapID1"]=document.getElementById("mapID1");

Regards,

Sudipto Choudhury
FusionCharts Team

Post #2912
Posted 10/31/2007 9:50:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/21/2008 6:02:11 AM
Posts: 3, Visits: 16
Sorry I must have misunderstood your solution, I am actually using the FusionCharts.dll and the vb.net examples

so I have something like this in HTML

<%=GetChart()%>

and code behind

Public function GetChart() as string

Dim strXML as string = GetChartData(DateRange)

return FusionCharts.RenderChart("fusioncharts/FCF_Column2D.swf","",strXML,"Chart1", "200","100", false,true)

end function

Works fine first time but not on ajax async postback, not sure how i can use your javascript solution code.

Post #2913
Posted 11/2/2007 5:36:51 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 8:31:36 AM
Posts: 763, Visits: 1,214
Hi,

try using renderChartHTML() instead of RenderChart()

Regards,

Sudipto Choudhury
FusionCharts Team

Post #2945
Posted 11/2/2007 8:07:44 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 8:31:36 AM
Posts: 763, Visits: 1,214
HI,

Here is a simple sample using FusionCharts in ASP.NET.AJAX Update Panel ... try this and explore more and let us know. We are currently developing more samples on various aspects and facets of UpdatePanel and ASP.NET.AJAX... we will publish them soon...

Developers eager to share their experiences of failure and success while using FusionCharts in Update Panel and ASP.NET.AJAX may post too.

Regards,

Sudipto Choudhury
FusionCharts Team


  Post Attachments 
FusionCharts.ASP.Net.AJAX.zip (107 views, 82.37 KB)

Post #2949
Posted 11/16/2007 8:41:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/21/2008 6:02:11 AM
Posts: 3, Visits: 16
Hi,
sorry its took so long to reply been busy!
Anyway thanks for your ajax example code it worked great for generating charts on 'postback' after the page has loaded.

However I wanted to generate the chart on 'Page Load' and then on 'Postbacks'

If you use RenderChartHTML on page load then you get the 'click to activate' message in IE.

If you use RenderChart on page load and then RenderChart on postbacks then the postback charts don't display.

However! If you use RenderChart on page load then RenderChartHTML on any postback then all problems are solved.

Not sure if there's an easier way around this but at least it works and I'm happy.


Post #3073
« Prev Topic | Next Topic »

««12

Permissions Expand / Collapse