Sign in to follow this  
phlk

Please help me with multi-series and data comming from DB (using asp class/DB_dataURLl)

Recommended Posts

Hi all,

I would really really appreciate some help! Below code works and data is fetched from DB and presented using line.swf

I have used these files DBConn.asp, FusionCharts_Gen.asp, FusionCharts.asp, Default.asp, PieData.asp to make it work.

As you see I have changed PieData.asp a bit to suit my needs. Now I need to use the multi series line 2d chart in order to present some more data.

How is that done??? Could someone please give an example of how below code would have to be modified... Please don't refer to the blueprints because they don't really help me much... :)

I am not expert here (suprise! :w00t:) so please bear with me.

Thanks very much to anyone taking the time to look into this for me.

Kindest regards

Peter

' Define chart attributes

   strParam="caption=HbA1c;subCaption=By Visit; xAxisName=Visit; yAxisName=HbA1c %; canvasRightMargin=20; canvasPadding=20; showValues=1; adjustDiv=0; numDivLines=5; yAxisMinValue=4; yAxisMaxValue=16; showBorder=0; showLabels=1; labelDisplay=Rotate; slantLabels=1; palette=3"

 

'Set chart attributes

Call FC.setChartParams(strParam)

 

   ' Fetch all records usins SQL Query

 ' Store chart data values in 'total' column/field and category names in 'FactoryName'

 dim strQuery

 strQuery = "SELECT G.PT, G.CPEVENT, G.LVALUE FROM NN304_3511$CURRENT.GLUCLATE G Where LPARM_CODE = 'HBA1C_BLOOD' AND PT = '200001'"

 

 Dim oRs

 'Create the recordset to retrieve data

  Set oRs = Server.CreateObject("ADODB.Recordset")

 Set oRs = oConn.Execute(strQuery)

 

 'Pass the SQL Query result to the FusionCharts ASP Class function

 'along with field/column names that are storing chart values and corresponding category names

 'to set chart data from database

 If Not oRs.bof Then

Call FC.addDataFromDatabase(oRs, "LVALUE", "CPEVENT", "", "")

 End If

 oRs.Close

 set oRs=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(FC.getXML())

Share this post


Link to post
Share on other sites

Hi,

 
To work with multi-series charts:

1. Add Category names:

addCategoryFromDatabase(oRs, "LVALUE")

2. Add Dataset series names and Value:

Call FC.addDatasetsFromDatabase (oRs, "{dataset series field}", "{Value field}", "", "")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this