TTMSFNCChartDataGridAdapter
The TTMSFNCChartDataGridAdapter can be used for binding the cells of a TTMSFNCDataGrid with the TTMSFNCChart via the Adapter property.
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 series collection that represents the columns. Below is an overview of the available properties and events.
With the BindSeries methods you can add a Series in one call.
Note
Important Notice: This requires TMS FNC UI Pack (separately available at the My Products page)
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.) |
| HeaderRow | Can be set to indicate on which row the headers are defined. (Default 0) |
Source |
The source to retrieve the data from and which contains the series to add. |
| SynchronizeOnDataGridUpdate | Can be set to update the chart when a cell was edited in the DataGrid. (Default True) |
Events
| Event name | Description |
|---|---|
| OnRowToPoint | Event that is triggered when a point was added with all of the available columns filled in. Gives the ability to further customize the point. |
| OnSetColumnValueIndex | Event that is triggered while going over all the columns to choose the series. |
| OnSetColumnValueType | Event that is triggered while going over all the columns to choose the type of the field. |
| OnSynchronized | Event that is triggered when a synchornization is done from the DataGrid data. |
TTMSFNCChartDataGridAdapterSource
The adapter source has two properties, the DataGrid which is the TTMSFNCDataGrid to connect with and the Series which is a collection that has the fieldnames for the different values.
TTMSFNCChartDataGridAdapterSeriesItem
The collection item that contains the column index for each value. One item creates a new series in the chart.
The properties can stay -1 except for YValueColumnIndex or YValueHighColumnIndex.
Properties
| Property name | Description |
|---|---|
| YValueColumnIndex | The column index used for the Y-Value of the series. |
| XValueColumnIndex | Optional, column index used for the X-Value of the series. |
| XLabelColumnIndex | Optional, column index used for the X-Label of the series. |
| YValueSecondColumnIndex | Optional, column index used for the Y-ValueSecond in a band type series. |
| YValueVariableColumnIndex | Optional, column index used for the Y-ValueVariable in e.g. a pie type series. |
| YValueHighColumnIndex | The column index used for the high value in a multi-point series. |
| YValueLowColumnIndex | The column index used for the low value in a multi-point series. |
| YValueOpenColumnIndex | The column index used for the open value in a multi-point series. |
| YValueCloseColumnIndex | The column index used for the close value in a multi-point series. |
| YValueMedianColumnIndex | Optional, column index used for the median value in a multi-point series. |
Code Example
// Create a new series for the DataGrid adapter and link it to the chart and DataGrid.
TMSFNCChart.Adapter := TMSFNCChartDataGridAdapter;
TMSFNCChartDataGridAdapter.Source.DataGrid := TMSFNCDataGrid;
TMSFNCChartDataGridAdapter.AutoCreateSeries := False;
s := TMSFNCChartDataGridAdapter.Source.Series.Add;
s.YValueColumnIndex := 1;
s.XLabelColumnIndex := 0;
TMSFNCChartDataGridAdapter.Active := True;