djjwp

Members
  • Content count

    13
  • Joined

  • Last visited

About djjwp

  • Rank
    Junior Member
  1. Fusioncharts and Codecharge

    http://www.fusioncharts.com/forum/Topic469-30-1.aspx Look here, it works well and can be replicated
  2. Fusion Charts and Code Charge Studio

    http://www.fusioncharts.com/forum/Topic469-30-1.aspx Works well
  3. I am using two pages to grab and display the data. The first page is launched and it then pulls the data from the second "data" page. I'm using the MSColumn3D.swf chart. dim stats dim rs dim sql dim cn dim rs1 dim sql1 dim cn1 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=serverip;DATABASE=netops;USER=root;PASSWORD=password;OPTION=3" set rs = server.createobject("adodb.recordset") sql = "SELECT Count(Ticket) as field0 FROM Tkt_tickets WHERE YEAR(ResolvedTime) = 2006 GROUP BY Year(ResolvedTime), Month(ResolvedTime)" cn1 = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=serverip;DATABASE=netops;USER=root;PASSWORD=password;OPTION=3" set rs1 = server.createobject("adodb.recordset") sql1 = "SELECT Count(Ticket) as field1 FROM Tkt_tickets WHERE YEAR(ResolvedTime) = 2007 GROUP BY Year(ResolvedTime), Month(ResolvedTime)" 'Start XML data strXML = "<chart caption='Tickets Worked Results 2006 v 2007' xAxisName='Month' yAxisName='Revenue' showValues='0' numberPrefix='$'> strXML = strXML & "<categories>" strXML = strXML & "<category label='Jan' />" strXML = strXML & "<category label='Feb' />" strXML = strXML & "<category label='Mar' />" strXML = strXML & "<category label='Apr' />" strXML = strXML & "<category label='May' />" strXML = strXML & "<category label='Jun' />" strXML = strXML & "<category label='Jul' />" strXML = strXML & "<category label='Aug' />" strXML = strXML & "<category label='Sep' />" strXML = strXML & "<category label='Oct' />" strXML = strXML & "<category label='Nov' />" strXML = strXML & "<category label='Dec' />" strXML = strXML & "</categories>" 'Open db and grab 2006 records strXML = strXML & "<dataset seriesName='2006' color='FF9601'>" rs.open sql, cn do while not rs.eof 'Write the data line strXML = strXML & "<set value='" & rs("field0") & "'/>" 'Go to next record rs.movenext loop strXML = strXML & "</dataset>" 'Open db and grab 2007 records strXML = strXML & "<dataset seriesName='2007' color='0000C0'>" rs1.open sql1, cn1 do while not rs1.eof 'Write the data line strXML = strXML & "<set value='" & rs1("field1") & "'/>" 'Go to next record rs1.movenext loop strXML = strXML & "</dataset>" strXML = strXML & "<trendlines>" strXML = strXML & "<line startValue='26000' color='91C728' displayValue='Target' showOnTop='1'/>" strXML = strXML & "</trendlines>" 'Finally, close <chart> element strXML = strXML & "</chart>" 'Close loops and conx rs.close Set rs = nothing rs1.close Set rs1 = 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) This is in the first page. '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 = "TktByMonthData.asp" 'Create the chart - Pie 3D Chart with dataURL as strDataURL Call renderChart("Includes/ChartsSWF/MSColumn3D.swf", strDataURL, "", "stats", 600, 400, false, false) Any help would be appreciated.
  4. CodeCharge Studio

    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.
  5. CodeCharge Studio

    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:
  6. CodeCharge Studio

    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
  7. CodeCharge Studio

    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.
  8. CodeCharge Studio

    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.
  9. CodeCharge Studio

    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.
  10. Fusion Charts and Code Charge Studio

    I've started working on this, currently stuck at getting the XML output froma single table. I have another post on here yopu can watch, when I get this figured out, I will post it.
  11. CodeCharge Studio

    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.
  12. CodeCharge Studio

    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
  13. CodeCharge Studio

    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