assigning dataset as XYchart datasource

TeeChart for ActiveX, COM and ASP
Post Reply
Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

assigning dataset as XYchart datasource

Post by Chuck » Thu Mar 15, 2007 2:00 pm

Hi I have a DataSet that I am using as the data source for an XY chart and assigning two parameters from the dataset as the X and Y values but I get a Catastrophic failure in ASP.net when I do so. Can you tell me if the code below is correct.

Chart.AddSeries(TeeChart.ESeriesClass.scLine);
Chart.Series(0).DataSource = data;
Chart.Series(0).XValues.ValueSource = "WAFER_SEQUENCE";
Chart.Series(0).YValues.ValueSource = "PARAMETER";

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Mar 15, 2007 3:25 pm

Hi Chuck,

Before giving you a reply, could you please confirm which exact TeeChart version are you using and in which environment are you using it? Reading your code I assume you are using TeeChart Pro ActiveX.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Thu Mar 15, 2007 3:28 pm

TeeChartPro V6 Active x on asp.net with dot net framework 2.0

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 20, 2007 11:09 am

Hi Chuck,

It works fine here using TeeChart Pro v7 ActiveX and the example at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual Studio .NET\VBWebForm changing genchart.aspx's code to:

Code: Select all

  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim TChart1 As TeeChart.TChartClass
    TChart1 = New TeeChart.TChartClass()

    TChart1.AddSeries(TeeChart.ESeriesClass.scBar)

			' This example uses Microsoft OLE DB
			' ActiveX Data Objects 2.0 Library.

			' declare a Connection and RecordSet variables...
			Dim Data As New ADODB.Connection
			Dim Record As New ADODB.Recordset

			' Open the sample table and database...
			' The "TeeChart Pro Database" ODBC DSN is
			' automatically added when installing TeeChart Pro...
			Data.Open("TeeChart Pro System db")
			Record.Open("employee", Data, 1, 1)

			' Retrieve records....
			TChart1.Series(0).Clear()

			TChart1.Series(0).DataSource = Record
			TChart1.Series(0).YValues.ValueSource = Record.Fields(1).Name
			TChart1.Series(0).LabelsSource = Record.Fields(0).Name

			' release variables...
			'UPGRADE_NOTE: Object Record may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
			Record = Nothing
			'UPGRADE_NOTE: Object Data may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
			Data = Nothing

    Response.BinaryWrite(TChart1.Export.asNative.SaveToStream(True))

  End Sub
However, we can not guarantee that this will work fine in v6 since several changes in the process of importing data from an URL had to be done for new Windows and Internet Explorer versions. Those changes were made in TeeChart Pro v7 ActiveX.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply