Replied 3 August 2017, 3:49 pm EST
You can bind ddAnalysiss to a SQLite database by first setting up an RdDataSource object with a connection type (I used ODBC in my testing), the connection string, and the SQL Query that will return all of the fields you wish to have available in the schema. Once this is setup you will need to create a schema file which can be automatically generated with the following C# code:
DataDynamics.Analysis.Schema.SchemaBuilder sb = DataDynamics.Analysis.Schema.SchemaBuilder.AutoGenerate("SchemaName",new System.Data.Odbc.OdbcConnection(connectionString),sqlQuery);
sb.Save(Application.StartupPath + "\\myschema.schema");
If you would like to make any modifications or additions to the schema, you would to do so before saving the schema to a file. Once you have generated the file, you will need to provide your RdDataSource instance's CustomSchemaFile property with the file's location and name. Then you can assign the RdDataSource to the PivotView's DataSource property and then use the datasource's connect method to open a connection to the database. Once the pivot view is bound the database, you can create the chart based on time by either dragging and dropping the fields to the shelves you want them on (i.e. your date field and a measure field), or you can do so programmatically by using an instance of the ILayoutActions interface to call methods that will place fields on the shelves. The following C# code demonstrates how to modify the pivot view layout to create a line chart of TotalSales over Years:
DataDynamics.Analysis.Estensions.Schema.SchemaDefinition schema = this.pivotView1.DataSource.Schema;
I have also attached a sample project that connects to a simple SQLite database that demonstrates how to connect to SQLite, generate a schema (with a custom calculated field), and apply the layout modification from above. If you have any further questions please feel free to let me know.