ISeries.DatasourceType
ISeries
property DatasourceType: EDatasourceType;
Type Library
TeeChartx
Description
Default = dstAllRecords
The EDataSourceTypes are dstAllRecords and dstSingleRecord. As the default is dstAllRecords, the DatasourceType method only really needs to be called for Single Record charting.
Example [Visual Basic]:
Dim rst
Private Sub Command1_Click()
rst.MovePrevious
CheckKeys
End Sub
Private Sub Command2_Click()
rst.MoveNext
CheckKeys
End Sub
Private Sub Command3_Click()
rst.MoveLast
CheckKeys
End Sub
Private Sub Command4_Click()
rst.MoveFirst
CheckKeys
End Sub
Private Sub Form_Load()
Set Conn = CreateObject("ADODB.Connection")
Set rst = CreateObject("ADODB.Recordset")
Conn.Open "DSN=TeeChart Pro Database"
rst.Open "select * from months", Conn, 1, 1
TChart1.AddSeries scBar
With TChart1.Series(0)
.ColorEachPoint = True
' ****************************************************************
' The DatasourceType line should be run before the Recordset is
' applied to the Series.
' ****************************************************************
.DatasourceType = dstSingleRecord
.DataSource = rst
.YValues.ValueSource = "Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"
End With
With TChart1.Tools
.Add tcAnnotate
.Items(0).asAnnotation.Position = ppLeftTop
End With
CheckKeys
End Sub
Private Sub CheckKeys()
TChart1.RefreshData
TChart1.Tools.Items(0).asAnnotation.Text = "Year: " & rst!Year
If rst!Year = "1997" Then
Command4.Enabled = False
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = True
ElseIf rst!Year = "2000" Then
Command2.Enabled = False
Command3.Enabled = False
Command1.Enabled = True
Command4.Enabled = True
Else
Command4.Enabled = True
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
End If
End Sub