CodeCharge Studio
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


««12

CodeCharge Studio Expand / Collapse
Author
Message
Posted 3/16/2007 1:50:06 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 2 days ago @ 8:20:12 AM
Posts: 2,194, Visits: 521
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.

Thanks,
Pallav Nadhani
FusionCharts Team

Post #567
Posted 3/16/2007 2:51:35 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 1/1/2008 9:38:37 AM
Posts: 13, Visits: 24
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.

Post #576
Posted 3/19/2007 1:46:47 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 2 days ago @ 8:20:12 AM
Posts: 2,194, Visits: 521
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.

Thanks,
Pallav Nadhani
FusionCharts Team

Post #578
Posted 4/11/2007 9:46:56 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 1/1/2008 9:38:37 AM
Posts: 13, Visits: 24
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.

Post #809
« Prev Topic | Next Topic »

««12

Permissions Expand / Collapse

All times are GMT -7:00, Time now is 8:05pm


Execution: 0.094.