mchacks
Members-
Content count
5 -
Joined
-
Last visited
About mchacks
-
Rank
Forum Newbie
-
We have gone through several iteration of code sharing and it has not reached anywhere. So instead of me sharing code, could you guys give me a working code of how to reload fusion chart based on an Ajax call (similar to code that I have shared earlier).
-
Tried.. Same error.
-
Yes.. All of the above are included.(Its actually an ascx file)
-
Other than what I have shared above, the other relevant things are here.. The WebMethod in asmx [WebMethod, ScriptMethod(ResponseFormat=ResponseFormat.Xml)] public XmlDocument GetFusionChartData() { try { WebPartModel wpm = new WebPartModel(); XmlTextReader xtr = new XmlTextReader(new StringReader(wpm.GetFusionChartData().ToString())); XmlDocument sendXML = new XmlDocument(); sendXML.Load(xtr); return sendXML; } catch (Exception ex) { Logger logger = new Logger(); logger.WriteException(ex, "GetFusionChartData", SPContext.Current.Web.CurrentUser); throw ex; } } And it returns <?xml version="1.0" encoding="utf-8"?> <chart caption="My Task Status" showBorder="1" baseFont="Arial" baseFontSize="10" outCnvBaseFontSize="12" bgColor="FFFFFF" paletteColors="47985E,F1AB65,8FB61B" pieRadius="100" enableSmartLabels="0"> <set label="This week" value="1" /> <set label="Overdue" value="0" /> <set label="Today" value="0" /> <styles> <definition> <style name="myValues" type="font" size="10" borderColor="000000" bgcolor="FFFFFF" leftMargin="10" letterSpacing="1" /> <style name="myCaption" type="font" font="Futura" size="12" bold="0" align="left" /> </definition> <application> <apply toObject="DataLabels" styles="myValues" /> <apply toObject="Caption" styles="myCaption" /> </application> </styles> </chart>
-
I have an ajax call to update the chart. The call works fine and returns XMLDocument. But when checking through IE F12, the script Fusionchart.js seems to throw the following.. SCRIPT438: Object doesn't support property or method 'toString' FusionCharts.js, line 135 character 73 I recently downloaded the trial version. Just to clarify.. Here is my chart render code.. fusionChart.Text = FusionCharts.RenderChart("../_layouts/FCharts/Pie3d.swf", "", xmlStr.ToString(), "myTasks", "400", "300", false, true); Here is my Ajax call.. $.ajax({ type: 'POST', url: strURL, data: "{}", datatype: "xml", contentType: "application/xml; charset=utf-8", success: function (data) { var chartObj = getChartFromId("myTasks"); chartObj.setDataXML(data); } }); Can someone tell me what needs to be done to fix this?