Time Series Controls
Null Values in a Subgroup
A subgroup of a subgroup-based time series chart is composed of multiple samples. In some cases, sample values may not be known. This page describes how to handle null values. The time series controls of the Silverlight Analytics package that are based on subgroups include the following:
The series classes of these respective charts are:
The subgroup classes are:
and the sample classes are:
The first step is to include the necessary namespace
for the controls and add a new series.
Add Null Values to a Subgroup
Below, we will add values, including null values, to Xbar subgroups of a Xbar chart (named xbarControl in the
examples below). The process is similar for the other charts listed above:
[Visual Basic]
' Create a new subgroup
Dim xsSubgroup As New XbarSubgroup()
' Add some sample values to the subgroup
xsSubgroup.Add(0.4)
xsSubgroup.Add(0.2)
xsSubgroup.Add(0.5)
' Exclude the last sample from calculations of the subgroup
xsSubgroup(2).Exclude = True
' Add the subgroup to the first series
xbarControl.SeriesCollection(0).Add(xsSubgroup)
' The first subgroup only shows a size of 2. Let's set the size of all subgroups
as 3. This is only
' necessary if all subgroups are missing values and built like the
first subgroup above
xbarControl.SeriesCollection(0).SubgroupSizeOptions =
SubgroupSizeOptions.FixedSize
xbarControl.SeriesCollection(0).SubgroupSize = 3
[Visual C#]
// Create a new subgroup
XbarSubgroup xsSubgroup = new XbarSubgroup();
// Add some sample values to the subgroup
xsSubgroup.Add(0.3);
xsSubgroup.Add(0.1);
xsSubgroup.Add(null);
// Add the subgroup to the first series
xbarControl.SeriesCollection[0].Add(xsSubgroup);
// Create another new subgroup
xsSubgroup = new XbarSubgroup();
// Add some sample values to the subgroup
xsSubgroup.Add(0.4);
xsSubgroup.Add(0.2);
xsSubgroup.Add(0.5);
// Exclude the last sample from calculations of the subgroup
xsSubgroup[2].Exclude = true;
// Add the subgroup to the first series
xbarControl.SeriesCollection[0].Add(xsSubgroup);
// The first subgroup only shows a size of 2. Let's set the size of all
subgroups as 3. This is only
// necessary if all subgroups are missing values and built like the
first subgroup above
xbarControl.SeriesCollection[0].SubgroupSizeOptions =
SubgroupSizeOptions.FixedSize;
xbarControl.SeriesCollection[0].SubgroupSize = 3;