PUDYASTO

Members
  • Content count

    8
  • Joined

  • Last visited

About PUDYASTO

  • Rank
    Forum Newbie
  • Birthday 10/12/1988

Profile Information

  • Gender
    Male

Contact Methods

  1. Multiseries Chart With Php Mysql

    Now with PHP I can solve My problem to..... This is My code and working with multiseries charts. <?php include "koneksi.php"; //Connection to Database include "FusionCharts.php"; //Charts $strXML = "<chart caption='Customers by QTY' yAxisName='QTY' xAxisName='Customers' numberPrefix='' formatNumberScale='0' rotateValues='1' placeValuesInside='1' decimals='0' >"; //Start XML Code connect_db(); //Call function of connection database $strquery = " SELECT kdpel, 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 FROM importjual WHERE (kd_brg BETWEEN '2-01-02-01-0005' AND '2-01-02-21-0100') AND (qty BETWEEN '1000' AND '8000') GROUP BY kdpel LIMIT 0,10"; //String Query database $query2 = mysql_query($strquery); //call string query $strCategories = "<categories>"; //create categories while ($cat = mysql_fetch_array($query2)) { $strCategories .= "<category label='" . $cat[0] . "' />"; //display categories }; $strCategories .= "</categories>"; $query3 = mysql_query($strquery); //call string query $K5 = "<dataset seriesName='MKIOS_05'>"; //create dataset while ($MK5 = mysql_fetch_array($query3)) { $K5 .= "<set value='" . $MK5[1] . "' />"; //display value of dataset } $K5 .= "</dataset>"; $query4 = mysql_query($strquery); //call string query $K10 = "<dataset seriesName='MKIOS_10'>"; //create dataset while ($MK10 = mysql_fetch_array($query4)) { $K10 .= "<set value='" . $MK10[2] . "' />"; //display value of dataset } $K10 .= "</dataset>"; $query5 = mysql_query($strquery); //call string query $K20 = "<dataset seriesName='MKIOS_20'>"; //create dataset while ($MK20 = mysql_fetch_array($query5)) { $K20 .= "<set value='" . $MK20[3] . "' />"; //display value of dataset } $K20 .= "</dataset>"; $strXML .= $strCategories . $K5 . $K10 . $K20 . "</chart>"; //end of XML echo renderChart("Charts/MScolumn3d.swf", "", $strXML, "productSales", 1400, 500, false, false); ?> I hope it can help your problems
  2. Multiseries Chart With Php Mysql

    Can u give me your example? how did not work?
  3. Multiseries With Asp

    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
  4. Multiseries With Asp

    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?
  5. Multiseries With Asp

    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?
  6. Multiseries With Asp

    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, strCategories, strDataCurr, strDataPrev, 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 name='" & response.Write(oRs.Fields("Kode_Pel").value) & "' />" oRs.movenext next 'loop strCategories = strCategories & "</categories>" strDataCurr = "<dataset seriesName='MKIOS_05'>" 'do while not oRs.eof for i=0 to oRs.Fields.count - 1 strDataCurr = strDataCurr & "<set value='" & response.Write(oRs.Fields("MKIOS_05").value) & "' />" oRs.movenext next 'loop strDataCurr = strDataCurr & "</dataset>" strDataPrev = "<dataset seriesName='MKIOS_10'>" 'do while not oRs.eof for i=0 to oRs.Fields.count - 1 strDataPrev = strDataPrev & "<set value='" & response.Write(oRs.Fields("MKIOS_10").value) & "' />" oRs.movenext next 'loop strDataPrev = strDataPrev & "</dataset>" strXMLI = strXML & strCategories & strDataCurr & strDataPrev & "</chart>" Call renderChart("Charts/MSColumn3D.swf", "", strXMLI, "productSales", 600, 300, false, false) %> </center> </BODY> </HTML> My chart cannot show and error result
  7. Multiseries Chart With Php Mysql

    I try to create xml from variable of php, like this $strXML = "<chart caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='1' showlegend='1' legendPosition='bottom' formatNumberScale='0' showBorder='1'>"; $strQuery = "SELECT SUM(qty) AS TotOutput,SUM(qty) + SUM(qty) AS TotOutput2,kd_brg FROM tjualtempjateng WHERE kd_brg BETWEEN '1-01-05-005-001' AND '2-01-02-01-0020' GROUP BY kd_brg ORDER BY kd_brg"; $result2 = mysql_query($strQuery) or die(mysql_error()); $strCategories = "<categories>"; // as <categories> while($ors2 = mysql_fetch_array($result2)){ $strCategories .= "<category name='" . $ors2['kd_brg'] . "' />"; } $strCategories .= "</categories>"; // as </categories> $strDataCurr = "<dataset seriesName='TotOutput'>"; // as <dataset> while($ors2 = mysql_fetch_array($result2)){ $strDataCurr .= "<set value='" . $ors2['TotOutput'] . "' />"; } $strDataCurr .= "</dataset>"; // as </dataset> $strDataCurr2 = "<dataset seriesName='TotOutput2'>"; // as <dataset> while($ors2 = mysql_fetch_array($result2)){ $strDataCurr2 .= "<set value='" . $ors2['TotOutput2'] . "' />"; } $strDataCurr2 .= "</dataset>"; // as </dataset> mysql_free_result($result2); $strXML .= $strCategories . $strDataCurr . $strDataCurr2 . "</chart>"; so, my xml is same as $strXml, For dataset1 is TotOutput and dataset2 is TotOutput2. For data from dataset I use looping from execute $strQuery (sorry if my english is not well)
  8. Whats wrong with my code : <?Php include ("koneksi.Php"); //connect to server include("FusionCharts.php"); $strXML = "<chart caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='1' showlegend='1' legendPosition='bottom' formatNumberScale='0' showBorder='1'>"; //Now create a second query to get details for this factory $strQuery = "SELECT SUM(qty) AS TotOutput,SUM(qty) + SUM(qty) AS TotOutput2,kd_brg FROM tjualtempjateng WHERE kd_brg BETWEEN '1-01-05-005-001' AND '2-01-02-01-0020' GROUP BY kd_brg ORDER BY kd_brg"; $result2 = mysql_query($strQuery) or die(mysql_error()); $strCategories = "<categories>"; while($ors2 = mysql_fetch_array($result2)){ $strCategories .= "<category name='" . $ors2['kd_brg'] . "' />"; } $strCategories .= "</categories>"; $strDataCurr = "<dataset seriesName='TotOutput'>"; while($ors2 = mysql_fetch_array($result2)){ $strDataCurr .= "<set value='" . $ors2['TotOutput'] . "' />"; } $strDataCurr .= "</dataset>"; $strDataCurr2 = "<dataset seriesName='TotOutput2'>"; while($ors2 = mysql_fetch_array($result2)){ $strDataCurr2 .= "<set value='" . $ors2['TotOutput2'] . "' />"; } $strDataCurr2 .= "</dataset>"; mysql_free_result($result2); //Finally, close <chart> element $strXML .= $strCategories . $strDataCurr . $strDataCurr2 . "</chart>"; echo renderChartHTML("Charts/MSColumn3D.swf", "", $strXML, "myNext", 1200, 500, false); ?> this result is empty chart, can you solve my problem?