PUDYASTO Report post Posted August 10, 2011 Now I use ASP, can help me, this is my source code <%@ Language=VBScript %> <HTML> <HEAD> <TITLE> FusionCharts - Array Example using Multi Series Column 3D Chart </TITLE> <script LANGUAGE="Javascript" SRC="JS/FusionCharts.js"></SCRIPT> </HEAD> <!-- #INCLUDE FILE="FusionCharts.asp" --> <!-- #INCLUDE FILE="DBConn.asp" --> <BODY> <center> <% Dim oRs, oRs2, strQuery Dim strXML, s Set oRs = Server.CreateObject("ADODB.Recordset") strQuery = "select top 10 a.* from (select kdpel as Kode_Pel , " & _ "SUM(case when kd_brg = '2-01-02-01-0005' then qty else 0 end) as MKIOS_05, " & _ "SUM(case when kd_brg = '2-01-02-01-0010' then qty else 0 end) as MKIOS_10, " & _ "SUM(case when kd_brg = '2-01-02-01-0020' then qty else 0 end) as MKIOS_20, " & _ "SUM(case when kd_brg = '2-01-02-01-0025' then qty else 0 end) as MKIOS_25, " & _ "SUM(case when kd_brg = '2-01-02-01-0050' then qty else 0 end) as MKIOS_50 " & _ "from IMPORTJUAL group by kdpel ) a " Set oRs = oConn.Execute(strQuery) 'do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 'response.Write(oRs.Fields("Kode_Pel").value) 'oRs.movenext 'next 'loop %> <% strXML = "<chart caption='Sales by Product' numberPrefix='' formatNumberScale='0' rotateValues='1' placeValuesInside='1' decimals='0' >" strCategories = "<categories>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 strCategories = strCategories & "<category label='" & oRs.Fields("Kode_Pel").value & "' />" oRs.movenext 'next loop strCategories = strCategories & "</categories>" strDataCurr = "<dataset seriesName='MKIOS_05' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 strDataCurr = strDataCurr & "<set value='" & oRs.Fields("MKIOS_05").value & "' />" oRs.movenext 'next loop strDataCurr = strDataCurr & "</dataset>" strDataPrev = "<dataset seriesName='MKIOS_10' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 strDataPrev = strDataPrev & "<set value='" & oRs.Fields("MKIOS_10").value & "' />" oRs.movenext 'next loop strDataPrev = strDataPrev & "</dataset>" strXML = strXML & strCategories & strDataCurr & strDataPrev & "</chart>" Call renderChart("Charts/MSColumn3D.swf", "", strXML, "productSales", 600, 300, false, false) %> </center> </BODY> </HTML> Result is My chart cannot show, can you help me? Share this post Link to post Share on other sites
Guest Angshu Report post Posted August 10, 2011 Hi, Welcome to FusionCharts Forum! Could you please send us the generated XML code to look into the issue? Awaiting for your response. Share this post Link to post Share on other sites
PUDYASTO Report post Posted August 11, 2011 On 8/10/2011 at 8:28 AM, Angshu said: Hi, Welcome to FusionCharts Forum! Could you please send us the generated XML code to look into the issue? Awaiting for your response. I've used generate XML code from variable like this : strXML = "<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units'>" strCategories = "<categories>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 strCategories = strCategories & "<category label='" & oRs.Fields("Kode_Pel").value & "' />" 'next oRs.movenext loop strCategories = strCategories & "</categories>" x1 = "<dataset seriesName='MKIOS_05' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x1 = x1 & "<set value='" & oRs.Fields("MKIOS_05").value & "' />" 'next oRs.movenext loop x1 = x1 & "</dataset>" x2 = "<dataset seriesName='MKIOS_10' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x2 = x2 & "<set value='" & oRs.Fields("MKIOS_10").value & "' />" 'next oRs.movenext loop x2 = x2 & "</dataset>" x3 = "<dataset seriesName='MKIOS_20' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x3 = x3 & "<set value='" & oRs.Fields("MKIOS_20").value & "' />" 'next oRs.movenext loop x3 = x3 & "</dataset>" x4 = "<dataset seriesName='MKIOS_25' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x4 = x4 & "<set value='" & oRs.Fields("MKIOS_25").value & "' />" 'next oRs.movenext loop x4 = x4 & "</dataset>" x5 = "<dataset seriesName='MKIOS_50' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x5 = x5 & "<set value='" & oRs.Fields("MKIOS_50").value & "' />" 'next oRs.movenext loop x5 = x5 & "</dataset>" strXML = strXML & strCategories & x1 & x2 & x3 & x4 & x5 & "</chart>" in this case, categories will show, but not with data, I don't know why it happen? Share this post Link to post Share on other sites
PUDYASTO Report post Posted August 11, 2011 On 8/11/2011 at 5:57 AM, PUDYASTO said: I've used generate XML code from variable like this : strXML = "<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units'>" strCategories = "<categories>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 strCategories = strCategories & "<category label='" & oRs.Fields("Kode_Pel").value & "' />" 'next oRs.movenext loop strCategories = strCategories & "</categories>" x1 = "<dataset seriesName='MKIOS_05' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x1 = x1 & "<set value='" & oRs.Fields("MKIOS_05").value & "' />" 'next oRs.movenext loop x1 = x1 & "</dataset>" x2 = "<dataset seriesName='MKIOS_10' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x2 = x2 & "<set value='" & oRs.Fields("MKIOS_10").value & "' />" 'next oRs.movenext loop x2 = x2 & "</dataset>" x3 = "<dataset seriesName='MKIOS_20' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x3 = x3 & "<set value='" & oRs.Fields("MKIOS_20").value & "' />" 'next oRs.movenext loop x3 = x3 & "</dataset>" x4 = "<dataset seriesName='MKIOS_25' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x4 = x4 & "<set value='" & oRs.Fields("MKIOS_25").value & "' />" 'next oRs.movenext loop x4 = x4 & "</dataset>" x5 = "<dataset seriesName='MKIOS_50' showValues='0'>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 x5 = x5 & "<set value='" & oRs.Fields("MKIOS_50").value & "' />" 'next oRs.movenext loop x5 = x5 & "</dataset>" strXML = strXML & strCategories & x1 & x2 & x3 & x4 & x5 & "</chart>" in this case, categories will show, but not with data, I don't know why it happen? I've got solution by myself, this is my code for multiseries : <%@ Language=VBScript %> <HTML> <HEAD> <TITLE> FusionCharts - Array Example using Multi Series Column 3D Chart </TITLE> <script LANGUAGE="Javascript" SRC="JS/FusionCharts.js"></SCRIPT> </HEAD> <!-- #INCLUDE FILE="FusionCharts.asp" --> <!-- #INCLUDE FILE="DBConn.asp" --> <BODY> <center> <% Dim oRs, oRs2, strQuery Dim strXML, s Set oRs = Server.CreateObject("ADODB.Recordset") strQuery = "select top 10 a.* from (select kdpel as Kode_Pel , " & _ "SUM(case when kd_brg = '2-01-02-01-0005' then qty else 0 end) as MKIOS_05, " & _ "SUM(case when kd_brg = '2-01-02-01-0010' then qty else 0 end) as MKIOS_10, " & _ "SUM(case when kd_brg = '2-01-02-01-0020' then qty else 0 end) as MKIOS_20, " & _ "SUM(case when kd_brg = '2-01-02-01-0025' then qty else 0 end) as MKIOS_25, " & _ "SUM(case when kd_brg = '2-01-02-01-0050' then qty else 0 end) as MKIOS_50 " & _ "from IMPORTJUAL group by kdpel ) a " Set oRs = oConn.Execute(strQuery) Set oRs2 = oConn.Execute(strQuery) Set oRs3 = oConn.Execute(strQuery) Set oRs4 = oConn.Execute(strQuery) Set oRs5 = oConn.Execute(strQuery) Set oRs6 = oConn.Execute(strQuery) 'do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 'response.Write(oRs.Fields("Kode_Pel").value) 'oRs.movenext 'next 'loop %> <% strXML = "<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units'>" strCategories = "<categories>" do while not oRs.eof 'for i=0 to oRs.Fields.count - 1 strCategories = strCategories & "<category label='" & oRs.Fields("Kode_Pel").value & "' />" 'next oRs.movenext loop strCategories = strCategories & "</categories>" x1 = "<dataset seriesName='MKIOS_05' showValues='0'>" do while not oRs2.eof 'for i=0 to oRs.Fields.count - 1 x1 = x1 & "<set value='" & oRs2.Fields("MKIOS_05").value & "' />" 'next oRs2.movenext loop x1 = x1 & "</dataset>" x2 = "<dataset seriesName='MKIOS_10' showValues='0'>" do while not oRs3.eof 'for i=0 to oRs.Fields.count - 1 x2 = x2 & "<set value='" & oRs3.Fields("MKIOS_10").value & "' />" 'next oRs3.movenext loop x2 = x2 & "</dataset>" x3 = "<dataset seriesName='MKIOS_20' showValues='0'>" do while not oRs4.eof 'for i=0 to oRs.Fields.count - 1 x3 = x3 & "<set value='" & oRs4.Fields("MKIOS_20").value & "' />" 'next oRs4.movenext loop x3 = x3 & "</dataset>" x4 = "<dataset seriesName='MKIOS_25' showValues='0'>" do while not oRs5.eof 'for i=0 to oRs.Fields.count - 1 x4 = x4 & "<set value='" & oRs5.Fields("MKIOS_25").value & "' />" 'next oRs5.movenext loop x4 = x4 & "</dataset>" x5 = "<dataset seriesName='MKIOS_50' showValues='0'>" do while not oRs6.eof 'for i=0 to oRs.Fields.count - 1 x5 = x5 & "<set value='" & oRs6.Fields("MKIOS_50").value & "' />" 'next oRs6.movenext loop x5 = x5 & "</dataset>" strXML = strXML & strCategories & x1 & x2 & x3 & x4 & x5 & "</chart>" Call renderChart("Charts/MSLine.swf", "", strXML, "productSales", 1000, 300, false, false) %> </center> </BODY> </HTML> My wrong is how to show variable oRs, cause I've used one variable. show I create new variable for oRs and my data wil be show. I hope can help for other newbie Share this post Link to post Share on other sites
Guest Angshu Report post Posted August 11, 2011 Hi, Glad to know that you have managed to resolve your problem. Happy FusionCharting! Share this post Link to post Share on other sites