TTMSFNCChartDatabaseAdapter
The TTMSFNCChartDatabaseAdapter
can be used for databinding with the Adapter property of the TTMSFNCChart
This adapter is responsible for connecting to the dataset and for loading, displaying and editing the data. The adapter exposes a set of properties for data visualization and manipulation and a column collection that represents the available fields. Below is an overview of the available properties and events.
Properties
Property name | Description |
---|---|
Active | Activates the adapter and displays the data from the dataset when the dataset is active. |
AutoCreateSeries | When true, automatically retrieves the fields from the dataset and creates series for each field. (Default True.) |
SkipFirstColumn | Can be set to skip the first column, as these are usually Ids. (Default True.) |
Source |
The source to retrieve the data from and which contains the series to add. |
Events
Event name | Description |
---|---|
OnFieldsToPoint | Event that is triggered when a point was added with all of the available fields filled in. Gives the ability to further customize the point. |
OnFieldsToSeries | Event that is triggered when a series was filled with all of the points. Gives the ability to further customize the series. |
OnSetFieldValueIndex | Event that is triggered while going over all the fields to choose the series. |
OnSetFieldValueType | Event that is triggered while going over all the fields to choose the type of the field. |
TTMSFNCChartDatabaseAdapterSource
The adapter source has two properties, the DataSource of the data and the Series
which is a collection that has the fieldnames for the different values.
TTMSFNCChartDatabaseAdapterSeriesItem
The collection item that contains the field names for each value. One item creates a new series in the chart.
The properties can stay empty except for YValue or YValueHigh.
Properties
Property name | Description |
---|---|
YValue | The fieldname used for the Y-Value of the series. |
XValue | Optional, fieldname used for the X-Value of the series. |
XLabel | Optional, fieldname used for the X-Label of the series. |
YValueSecond | Optional, fieldname used for the Y-ValueSecond in a band type series. |
YValueVariable | Optional, fieldname used for the Y-ValueVariable in e.g. a pie type series. |
YValueHigh | The fieldname used for the high value in a multi-point series. |
YValueLow | The fieldname used for the low value in a multi-point series. |
YValueOpen | The fieldname used for the open value in a multi-point series. |
YValueClose | The fieldname used for the close value in a multi-point series. |
YValueMedian | Optional, fieldname used for the median value in a multi-point series. |
Code Example
// Create a new series for the database adapter and connect it to the chart and data source.
TMSFNCChart.Adapter := TMSFNCChartDatabaseAdapter;
TMSFNCChartDatabaseAdapter.Source.DataSource := myDataSource;
TMSFNCChartDatabaseAdapter.AutoCreateSeries := False;
s := TMSFNCChartDatabaseAdapter.Source.Series.Add;
s.YValue := 'myValuesFieldName';
s.XValue := 'myXValuesFieldName';
s.XLabel := 'myLabelsFieldName';
TMSFNCChartDatabaseAdapter.Active := True;