IValueList.ValueSource
IValueList

property ValueSource: WideString;

Type Library
TeeChartx

Description
Each TChart Value List has a ValueSource property. You can set this string property to different kind of values:

Case 1. A Chart Series is connected to an ODBC v3 database source:

If the Series that owns this ValueList is attached to a TChart and the Series.DataSource property is an ODBC v3 Table or SQL Query which provides database records, then the ValueSource property must refer to an existing numeric, date, time or datetime Field Name in the underlying dataset.

Example [Visual Basic]:

With TChart1.Series( 0 )

.DataSource = "DSN=Paradox files; TABLE=DOLLAR"

.YValues.ValueSource = "Dollar_exchange"

End with

"Dollar_exchange" being a numeric Field Name in Table "DOLLAR".

Case 2. A Chart Series is connected to another Chart Series:

If the Series which owns this ValueList is attached to a TChart and if the Series.DataSource property is any Series class, then the ValueSource property must refer to an existing IValueList Name in the underlying Series.

Example [Visual Basic]:

With TChart1.Series( 0 )

.DataSource="Series1"

.YValues.ValueSource="Y"

End with

Y being the Series2.YValues.Name.

NOTE:

Changing the ValueSource property both at design or runtime, will force the Series to fill again its values from the specified DataSource.

This must be specially considered when the DataSource Series property is a database Table or Query, because maybe it takes a long time to retrieve all records.

If the dataset is closed, the automatic record retrieving will be performed later on, when the dataset is opened again.

ValueSource Example

Being Quantity, a former numeric Field Name in Table1.

Visual Basic

Private Sub Command2_Click()

With TChart1.Series(0)

.LabelsSource = "Date"

.YValues.ValueSource = "Dollar_exchange"

.DataSource = "DSN=Paradox files; TABLE=DOLLAR"

End With

end sub

Where "Dollar_exchange is a field in the table "DOLLAR"