Page 1 of 1

assigning dataset as XYchart datasource

Posted: Thu Mar 15, 2007 2:00 pm
by 9089490
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";

Posted: Thu Mar 15, 2007 3:25 pm
by narcis
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.

Posted: Thu Mar 15, 2007 3:28 pm
by 9089490
TeeChartPro V6 Active x on asp.net with dot net framework 2.0

Posted: Tue Mar 20, 2007 11:09 am
by narcis
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.