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

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   phlk 

  • Forum Newbie
  • Group: Members
  • Posts: 6
  • Joined: 17-April 09

Posted 18 April 2009 - 01:15 PM

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())

0

Other Replies To This Topic

#2 User is offline   Rahul Kumar 

  • Supreme Being
  • Group: Moderators
  • Posts: 1041
  • Joined: 18-March 08

Posted 20 April 2009 - 02:29 AM

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}", "", "")

Regards,
Rahul Kumar
Software Engineer

A byte of magic.

 
0

Other Replies To This Topic

#3 User is offline   phlk 

  • Forum Newbie
  • Group: Members
  • Posts: 6
  • Joined: 17-April 09

Posted 23 April 2009 - 01:54 PM

Thanks very much!

Got it now :-)

Kind regards

Peter

0

Other Replies To This Topic

#4 User is offline   Sudipto Choudhury 

  • Supreme Being
  • Group: Administrators
  • Posts: 1919
  • Joined: 19-March 07

Posted 23 April 2009 - 02:36 PM

nice to hear it worked!:w00t:
Regards,

Sudipto Choudhury
FusionCharts Team

Follow us on Twitter

I code, therefore I am.

0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic