djjwp Report post Posted March 7, 2007 I will be purchasing Fusion Charts and will need to get it working within CCS projects. I'm looking for anyone who has done this before and can offer any type of "how to". :w00t: Thanks Don Share this post Link to post Share on other sites
Pallav Report post Posted March 7, 2007 Hi, As of now, we've not yet integrated FusionCharts with CCS. However, if someone is willing to take this initiative, we can help in all possible ways. Share this post Link to post Share on other sites
djjwp Report post Posted March 8, 2007 Palliv, Please read this thread when you have time. http://forums.yessoftware.com/posts.php?post_id=83883&s_keyword=Fusion This CCS user has it working with PHP and I will need it working with ASP as well. I am willing to attempt to document this but may need some help in debugging the process. Thanks Don Share this post Link to post Share on other sites
Pallav Report post Posted March 9, 2007 Yes Don. We would be glad to help you with all integration/debugging issues. Share this post Link to post Share on other sites
djjwp Report post Posted March 13, 2007 I have made some progress in that I can get some of the data using the db examples but can I get pointed to an example like the BasicDBExample.asp with only one table involved. The data I need to pull in would come from a query like this... Table: ID, TktNbr, Fname, LName, Lead, Agent 1,123,John,Smith,1,0 2,124,Jane,Doe,0,1 3,125,Bob,Jones,1,0 4,126,John,Smith,1,0 select count(id) as Tickets, concat(FName," ",LName) as Name where Lead =1 Group by Lname Resulting in: 2, John Smith 1, Bob Jones Now I would need that in to an xmlString Once I get that working, I will be able to see and document how to make CodeCharge Studio use it. I know this may be simple but I just have never had to do this, CCS makes it so easy and does not use XML. Share this post Link to post Share on other sites
djjwp Report post Posted March 14, 2007 Made some headway but I'm getting an error when it goes to render the chart: Line: 10 Char: 3 Error: 'FusionCharts' is undefined Code: 0 URL: http:// IP /ReportsV1/DEV/NewPage1.asp Do you want to continue running scripts on this page. I select yes and I get a blank page with "Chart." on top. I have seen referance to this on several sites but no resolution. Share this post Link to post Share on other sites
Pallav Report post Posted March 15, 2007 This is when you've not included FusionCharts.js in the HTML file. Share this post Link to post Share on other sites
djjwp Report post Posted March 15, 2007 Got past that error. I created a sub folder called include and placed the .JS, .asp, and the Pie3d.swf file in it and made sure it points to the file. I added a print atatement and see my data on the page when it does the loop. I see no chart at all or attempt to render it. :w00t: The page is blank except the data printed from within the loop. Share this post Link to post Share on other sites
djjwp Report post Posted March 15, 2007 (edited) I may nave the reason but not the answer as to why. :w00t: here is the code after it runs... <!-- START Script Block for Chart stats --> <div id='statsDiv' align='center'> Chart. </div> <script type="text/javascript"> //Instantiate the Chart var chart_stats = new FusionCharts("/Includes/Pie3D.swf", "stats", "600", "300", "0", "0"); //Provide entire XML data using dataXML method chart_stats.setDataXML("<chart caption=' Tickets' subCaption='' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Tickets'> <set label='CRAG' value='1738'/><set label='RUT' value='2955'/> <set label='SWEET' value='799'/><set label='YANO' value='24'/></chart>"); //Finally, render the chart. chart_stats.render("statsDiv"); </script> <!-- END Script Block for Chart stats --> <%@ Language=VBScript %> <html> <head> <TITLE> NOC Test Page </TITLE> <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } .text{ font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> <SCRIPT LANGUAGE="Javascript" SRC="Includes/FusionCharts.js"></SCRIPT> </head> <body> <p align="center"><br> <br> <a href="/ReportsV1/DEV/Includes/NoChart.html" target="_blank">Unable to see the chart above?</a> </p> </body> </html> It appears that when I place the code into the "before show" event it executes before loading the html, its backwards. In CodeCharge Studio (CCS) using PHP, this works, in ASP it will not. Edited April 11, 2007 by Guest Share this post Link to post Share on other sites
djjwp Report post Posted March 15, 2007 (edited) This is the Before Show code: dim stats dim rs dim sql dim cn dim field1 dim field2 'strXML will be used to store the entire XML document generated Dim strXML 'Make db conx cn = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=1.1.1.1; DATABASE=netops;USER=root; PASSWORD=password;OPTION=3" set rs = server.createobject("adodb.recordset") sql = "SELECT Count(tkt_tickets.ID) AS field1, Tkt_tickets.ResolvedBy as field2 FROM contacts INNER JOIN Tkt_tickets ON contacts.LName = Tkt_tickets.ResolvedBy Where LEAD=1 GROUP BY Tkt_tickets.ResolvedBy" 'Start XML data strXML = "<chart caption=' Tickets' subCaption='' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Tickets'>" 'Open db and grab records rs.open sql, cn do while not rs.eof 'Write the data line strXML = strXML & "<set label='" & rs("field2") & "' value='" & rs("field1")& "'/>" 'Print data to Print rs("field2") & " " & rs("field1") & "<br>" 'Go to next record rs.movenext loop 'Close loop and conx rs.close set rs = nothing 'Finally, close <chart> element 'Finally, close <chart> element strXML = strXML & "</chart>" 'Create the chart - Pie 3D Chart with data from strXML Call renderChart("/Includes/Pie3D.swf", "", strXML, "stats", 600, 300, false, false) Set rs = nothing Edited March 18, 2007 by Guest Share this post Link to post Share on other sites
Pallav Report post Posted March 16, 2007 Don, I've not understood this part, as I'm not familiar with CodeCharge Studio (though, I've a lot of experience in ASP). If you can please elaborate more on the process flow, I can help you with this. Share this post Link to post Share on other sites
djjwp Report post Posted March 16, 2007 (edited) CCS separates the code during development and the HTML is included in the ASP when it runs. The html page gets the .js include A label is then added to the page and the Code for the chart is placed in the before show event on the label which is in the ASP file. What appears to be happening is the before event triggers and displays what it has from the ASP file and then goes back to include the .js from the html which then will render an empty chart. I have it working in PHP but can not get it to do what I need it to ASAP. :w00t: Edited March 18, 2007 by Guest Share this post Link to post Share on other sites
Pallav Report post Posted March 19, 2007 So, effectively before the FusionCharts.js is being included, the chart code is being invoked? In that case, can you try using the renderChart() (ASP Function) from FusionCharts.asp? That will make CCS think of the code as ASP - and this code outputs HTML code for the chart. Share this post Link to post Share on other sites
djjwp Report post Posted April 11, 2007 (edited) Solution: Create a folder called Charts, then a subfolder called Includes and then one in there of ChartsSWF. You end up with this structure: Charts Includes ChartsSWF Now put your SWF files into the ChartsSWF folder In the Includes folder place FusionCharts.asp and FusionCharts.js. Now in the Charts Folder, create two pages; Charts.asp and ChartsData.asp Edit Charts.asp and add <script language="Javascript" src="Includes/FusionCharts.js"></script> just above the </head> tag in the HTML tab. Switch to the Code tab and insert: <!-- #INCLUDE VIRTUAL="/ReportsV1/Charts/Includes/FusionCharts.asp" --> to the 'Includes Common Files' section at the page top and then move to the bottom of the page and add: 'Variable to contain dataURL Dim strDataURL 'Set DataURL with animation property to 1 'NOTE: It's necessary to encode the dataURL if you've added parameters to it 'strDataURL = encodeDataURL("ChartsData.asp?animate=1") strDataURL = "ChartsData.asp" 'Create the chart - Pie 3D Chart with dataURL as strDataURL Call renderChart("Includes/ChartsSWF/Column3D.swf", strDataURL, "", "stats", 600, 400, false, false) Open the ChartsData.asp Open the HTML tab and remove all code, leave it blank. Add Custon Code to On Initialize Code and add the following, edit as needed: dim statsdim rs dim sql dim cn dim field1 'Hold data returned dim field2 'Hold name dim strXML 'strXML will be used to store the entire XML document generated 'Default.asp has passed us a property animate. We request that. Dim animateChart animateChart = Request.QueryString("animate") 'Set default value of 1 if animateChart="" then animateChart = "1" end if 'Make db conx cn = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=Your server IP;DATABASE=YourDB;USER=root;PASSWORD=YourPassword;OPTION=3" set rs = server.createobject("adodb.recordset") 'Create your SQL here, this was mine sql = "SELECT Count(tkt_tickets.ID) AS field1, Tkt_tickets.ResolvedBy as field2 FROM contacts INNER JOIN Tkt_tickets ON contacts.LName = Tkt_tickets.ResolvedBy Where DAYLIGHT=1 GROUP BY Tkt_tickets.ResolvedBy" 'Start XML data strXML = "<chart caption=' Tickets Closed By Daylight Operators' subCaption='1/1/2006 to 12/31/2006' pieSliceDepth='30' showBorder='0' formatNumberScale='0' numberSuffix=' Tickets' animation='0'>" 'Open db and grab records rs.open sql, cn do while not rs.eof 'Write the data line strXML = strXML & "<set label='" & rs("field2") & "' value='" & rs("field1")& "'/>" 'Go to next record rs.movenext loop 'Finally, close <chart> element strXML = strXML & "</chart>" 'Close loop and conx rs.close Set rs = nothing 'Set Proper output content-type Response.ContentType = "text/xml" 'Just write out the XML data 'NOTE THAT THIS PAGE DOESN'T CONTAIN ANY HTML TAG, WHATSOEVER Response.Write(strXML) Good luck, It does work well and can be replicated just by coping the pages and changing the query. Thanks to all who helped me get this working. Edited April 11, 2007 by Guest Share this post Link to post Share on other sites
sardinasanibal Report post Posted August 2, 2011 This is the Before Show code: dim stats dim rs dim sql dim cn dim field1 dim field2</P><P>'strXML will be used to store the entire XML document generated Dim strXML</P><P>'Make db conx cn = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=1.1.1.1; DATABASE=netops;USER=root; PASSWORD=password;OPTION=3" set rs = server.createobject("adodb.recordset") sql = "SELECT Count(tkt_tickets.ID) AS field1, Tkt_tickets.ResolvedBy as field2 FROM contacts INNER JOIN Tkt_tickets ON contacts.LName = Tkt_tickets.ResolvedBy Where LEAD=1 GROUP BY Tkt_tickets.ResolvedBy"</P><P>'Start XML data strXML = "<chart caption=' Tickets' subCaption='' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Tickets'>" </P><P> 'Open db and grab records rs.open sql, cn</P><P> do while not rs.eof 'Write the data line strXML = strXML & "<set label='" & rs("field2") & "' value='" & rs("field1")& "'/>" 'Print data to Print rs("field2") & " " & rs("field1") & "<br>"</P><P>'Go to next record rs.movenext loop</P><P>'Close loop and conx rs.close set rs = nothing</P><P>'Finally, close <chart> element 'Finally, close <chart> element strXML = strXML & "</chart>" 'Create the chart - Pie 3D Chart with data from strXML Call renderChart("/Includes/Pie3D.swf", "", strXML, "stats", 600, 300, false, false)</P><P>Set rs = nothing Hola! me podrias pasar el codigo que pones en el html y en el codigo de eventos, en que parte se pone el #include Virtual = /FusionCharts.asp??? y en que form incluis el codigo del before event. gracias! Share this post Link to post Share on other sites
Guest Angshu Report post Posted August 3, 2011 Hi, Welcome to FusionCharts Forum! Could you please elaborate your query a bit more in english? Awaiting for your response. Share this post Link to post Share on other sites
sardinasanibal Report post Posted August 3, 2011 Hi, Welcome to FusionCharts Forum! Could you please elaborate your query a bit more in english? Awaiting for your response. Hi, I am working with CCS and I have to make graphics with FusionChart I wonder if I could say how to apply with CodeCharge FusionCharts in asp. where in place the #include virtual = /fusioncharts.asp as the code in the html label Before show In short, what is the code I have to put the html and code in CodeCharge, and in the event show the label Before and if possible an example thanks Share this post Link to post Share on other sites
sardinasanibal Report post Posted August 17, 2011 Solved Share this post Link to post Share on other sites
Guest Angshu Report post Posted August 22, 2011 Hi, Glad to know that you have managed to resolve your problem. Could you please share the solution in this forum thread? Happy FusionCharting! Share this post Link to post Share on other sites