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.