Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help on creating Dynamic chart on Web. thru OWC10

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,25791
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Help on creating Dynamic chart on Web. thru OWC10
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help on creating Dynamic chart on Web. thru OWC10 - 9/9/2005 5:28:18 AM   
  akkua123

 

Posts: 15
Score: 0
Joined: 6/21/2005
From: USA
Status: offline
Hi

Thank you all for the previous help.I am trying to create a test dynamic chart on Web using owc10.I can create single chart for a student information table which plots "TEST' on x-axis and "SCORES" on y-axis for each student.But I could not create a "series" by using 'Seriescollection" .So that I can plot a goup of students at a time.Like if we have 3 students in the table I wish to get 3 different plots in a single chart.I could bo it in OWC11.But I am here resrticted with OWC10.

The code is shown below.


<%@ Language="vbscript" CodePage="65001"%>
<%
   Response.Buffer = TRUE
   Response.ContentType = "text/xml"
   Dim sCat, objSeries
   sCat = Request.QueryString("Category")
   'Connect to the SQL Server Northwind database.
   Dim conn, rs
   Set conn = CreateObject("ADODB.Connection")
   'conn.Open "Provider=SQLOLEDB;Data Source=SQLServer;Initial Catalog=Northwind;UID=sa"
   conn.Open "Provider=SQLOLEDB;SERVER=TOWSQL99;UID=akumar;Pwd=asdfgh;DATABASE=test_AK"
   'Execute a query that returns records based on the Category ID.
   Set rs = CreateObject("ADODB.Recordset")
  ' rs.Open "SELECT ProductName, ProductSales From [Product Sales for 1997] " & _
  '         "Where CategoryName='" & sCat & "'", conn, 3
   rs.Open "select student, test, score from testscore where subject='" & sCat & "' order by test", conn, 3
   'Build an array for the ProductName field and an array for the ProductSales field.
   ReDim aStudent(rs.RecordCount - 1)
   ReDim aTest(rs.RecordCount - 1)
   ReDim aScore(rs.RecordCount - 1)
   Dim i, j
   Do While Not rs.EOF
       aStudent(i) = rs.Fields("student")
       aTest(i) = rs.Fields("test")
       aScore(i) = rs.Fields("score")
       i = i + 1
       rs.MoveNext
   Loop
   'Close the connection to the database.
   rs.close
   conn.Close
   Set rs= Nothing
   Set conn = Nothing
   'Create a new bar chart.
   Dim ChartSpace1, Cht, c, axis
   Set ChartSpace1 = CreateObject("OWC10.Chartspace")
   Set c = Chartspace1.Constants
   Set cht = Chartspace1.Charts.Add
  ' cht.Type = c.chChartTypeBarClustered
    cht.Type = c.chChartTypeLineMarkers
 
  'Add the data to the chart.
   cht.SetData c.chDimSeriesNames, c.chDataLiteral, "Student"
   cht.SetData c.chDimCategories, c.chDataLiteral, aTest
   cht.SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, aScore
   for each axis in cht.Axes
         axis.HasTitle = True
            if axis.Type = c.chCategoryAxis then
              axis.Title.Caption = "Date"
            else
              axis.Title.Caption = "Size"
         end if
    next
   'Format chart elements.
   Chartspace1.Border.Color = "Rosybrown"
   ChartSpace1.Border.Weight = c.owcLineWeightMedium
   cht.SeriesCollection(0).Interior.Color = "Rosybrown"
   cht.PlotArea.Interior.Color = "Wheat"
   'Return the new chart's XML.
   Response.Write Chartspace1.XMLData
   Response.End

%>
     
</HTML>
   

_____________________________

Amaran
 
 
Post #: 1
 
 RE: Help on creating Dynamic chart on Web. thru OWC10 - 9/12/2005 12:12:58 AM   
  akkua123

 

Posts: 15
Score: 0
Joined: 6/21/2005
From: USA
Status: offline
Hi All,

I was expecting some reply.But no...Has anybody know about Dynamic charting using 'OWC10' ?



_____________________________

Amaran

(in reply to akkua123)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Help on creating Dynamic chart on Web. thru OWC10 Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts