-
Notifications
You must be signed in to change notification settings - Fork 14
DataSource
DataSource
This class contains methods and properties related to the data source for the chart.
The following sections contain a detailed description of the methods and properties.
In this property you pass the name(s) of the field(s) that contains the data to be displayed.
- If you pass one fieldname one dataset is generated.
- If you pass an array of fieldnames multiple datasets are generated.
--
myChart.Chart.DataSource.DataFieldNames = "Dataset1"
'or
myChart.Chart.DataSource.DataFieldNames = Array("Dataset1", "Dataset2", "Dataset3")
LabelFieldName, ObjectName, Recordset, SQLStatement
Calling this method, you can init the data source with some optional parameters.
- DataSourceType :: Type of data source
- DataSource :: Data source object
- DataFieldNames :: List of fieldnames containing the data
- LabelFieldName :: Fieldname containing the label information
--
myChart.Chart.DataSource.Init (dstTableName, "tbl_DemoData")
In this property you pass the name of the field that contains the labels of the data to be displayed.
--
myChart.Chart.DataSource.LabelFieldName = "DataLabel"
DataFieldNames, ObjectName, Recordset, SQLStatement
With this property you pass the name of an object that contains the data to be displayed in the chart.
You can transfer the name of a table or a query as the DataSourceObject.
--
myChart.Chart.DataSource.ObjectName = "tbl_DemoData"
or
myChart.Chart.DataSource.ObjectName = "qry_DemoData"
DataFieldNames, LabelFieldName, Recordset, SQLStatement
With this property you pass an open recordset that contains the data to be displayed in the chart.
Recordsets of the type dao
and adodb
are accepted.
--
Set rst = CurrentDb.OpenRecordset("Select * from tbl_DemoData order by pkid desc")
Set myChart.Chart.DataSource.Recordset = rst
DataFieldNames, LabelFieldName, ObjectName, SQLStatement
With this property you pass a sql statement that delivers the data to be displayed in the chart.
--
myChart.Chart.DataSource.SQLStatement = "Select * from tbl_DemoData order by pkid desc"