Time Series Controls
Data Binding
This page describes how to data bind the time series controls .
The time series controls of the .Net Analytics package include the following:
The first step is to include the necessary namespaces
for the controls and add a chart.
Programmatically Databind a Chart
Below, we will programmatically databind an Individuals chart (named indChart in the
examples below). You can also use the Properties window to graphically access
the databound properties for the chart. The process is similar for all of the other charts:
[Visual Basic]
' Add some data to the dataset dsDataSet - could also have dataset bound
to a database
DataRow drRow = dsDataSet.Tables(0).NewRow()
drRow(0) = 0.134
dsDataSet.Tables(0).Rows.Add(drRow)
drRow = dsDataSet.Tables(0).NewRow()
drRow(0) = 0.423
dsDataSet.Tables(0).Rows.Add(drRow)
drRow = dsDataSet.Tables(0).NewRow()
drRow(0) = 0.314
dsDataSet.Tables(0).Rows.Add(drRow)
' Programmatically set the databound fields
indChart.DataSource = dsDataSet.Tables(0)
indChart.DataValueField = "ValueColumn"
[Visual C#]
// Add some data to the dataset dsDataSet - could also have dataset bound to
a database
DataRow drRow = dsDataSet.Tables[0].NewRow();
drRow[0] = 0.134;
dsDataSet.Tables[0].Rows.Add(drRow);
drRow = dsDataSet.Tables[0].NewRow();
drRow[0] = 0.423;
dsDataSet.Tables[0].Rows.Add(drRow);
drRow = dsDataSet.Tables[0].NewRow();
drRow[0] = 0.314;
dsDataSet.Tables[0].Rows.Add(drRow);
// Programmatically set the databound fields
indChart.DataSource = dsDataSet.Tables[0];
indChart.DataValueField = "ValueColumn";
After the data binding, the resulting
chart should look similar to the following: