Powderworks Report post Posted September 26, 2012 Getting a no data message I am sure I have got it wrong in the Code any suggestions would be helpful Here is the code public string GetFactorySummaryChartHtml() { //In this example, we show how to connect FusionCharts to a database. //For the sake of ease, we've used an Access database which is present in //../App_Data/FactoryDB.mdb. It just contains two tables, which are linked to each //other. //xmlData will be used to store the entire XML document generated StringBuilder xmlData = new StringBuilder(); //Generate the chart element xmlData.Append("<chart caption='' subCaption='OUTSTANDING RECOMMENDATIONS' pieSliceDepth='30' UseRoundEdges = '1' showBorder='0' useRoundEdges = '1' formatNumberScale='0' numberSuffix=''>"); //Create recordset to get details for the factories //string factoryQuery = " SELECT Count(Recommendations) as TotNo FROM recommendations WHERE Complete = "No" , Count(Recommendation) as TotYes FROM recommendations WHERE Complete = "Yes"" ; string factoryQuery = "SELECT location.LocationName, recommendations.Complete, Count(*) as TotQ FROM recommendations INNER JOIN inspection ON recommendations.InspectionID = inspection.InspectionID INNER JOIN location ON inspection.LocationID = location.LocationID GROUP BY recommendations.Complete,location.LocationName"; DbConn oRs = new DbConn(factoryQuery); //Iterate through each record while (oRs.ReadData.Read()) { String seriesName = " "; if (oRs.ReadData["Complete"].ToString() == "Complete") { seriesName = "Complete"; } if (oRs.ReadData["Complete"].ToString() == "Outstanding") { seriesName = " Outstanding"; } if (oRs.ReadData["Complete"].ToString() == "In Progress") { seriesName = "In Progress"; } if (oRs.ReadData["Complete"].ToString() == "Not Accepted") { seriesName = "Not Accepted"; } xmlData.AppendFormat("<set label='{0}' value='{1}' />", (oRs.ReadData["LocationName"].ToString()), oRs.ReadData["Complete"].ToString(), oRs.ReadData["TotQ"].ToString()); //xmlData.AppendFormat("<set label='{0}' value='{1}' />", oRs.ReadData["Complete"].ToString(), oRs.ReadData["TotQ"].ToString()); } oRs.ReadData.Close(); //Close chart element xmlData.Append("</chart>"); //Create the chart - Pie 3D Chart with data from xmlData return FusionCharts.RenderChart("FusionCharts/MSColumn2D.swf?noCache=112", "", xmlData.ToString(), "FactorySum3", "400", "400", false, false); } Share this post Link to post Share on other sites
FusionCharts Support Report post Posted September 26, 2012 Hi, The XML that is being built is generating XML for a single series chart like Pie. Your XML can be in a format similar to: <chart> <set label='foo' value='1' /> <set label='boo' value='2' /> <set label='moo' value='3' /> </chart> However, since you are rendering a Multi-series chart, you need to build the XML following a different XML format which may look like: <chart> <categories> <category label='foo'/> <category label='boo'/> <category label='moo'/> </categories> <dataset> <set value='1'/> <set value='2'/> <set value='3'/> </dataset> </chart> For more details on Multi-series XML structure please read: http://docs.fusioncharts.com/charts/?DataFormats/XML/MultiSeries.html Share this post Link to post Share on other sites
Powderworks Report post Posted September 26, 2012 Thanks for comming back to me . I have read the information I am taking data from a MS SQL database and cant see how you program the XML file Do you any examples of how to set up the XML file in ASP.net Share this post Link to post Share on other sites
Powderworks Report post Posted September 26, 2012 Found the answer here http://docs.fusioncharts.com/charts/contents/guide-for-web-developers/csnet/CS_DB.html Share this post Link to post Share on other sites