Time Series Controls
Axis Types
This page describes how to change the type of axis for a time series control. The axis type generally affects the sorting of the data in a series.
The time series controls of the .Net Analytics package include the following:
The series classes of the respective charts are:
The axis that supports multiple types (index, date, key, etc.) is the x-axis of the charts, which is of the following type:
The property for indicating the type of x-axis is:
The x-axis types supported by the time series controls include:
- Code: data are sorted by the code property of the samples and the code is shown on the x-axis
- Date: data are sorted by the date/time of the samples and the date is shown on the x-axis
- DateIndex: data are sorted by the date/time of the samples, the date is shown on the x-axis, and the points are evenly spaced
- DateTime: data are sorted by the date/time of the samples and the date/time is shown on the x-axis
- DateTimeIndex: data are sorted by the date/time of the samples, the date/time is shown on the x-axis, and the points are evenly spaced
- Index: data are sorted by the order they are added to the series and the index is shown on the x-axis
- Key: data are sorted by the key (string) property of the samples/subgroups and the key is shown on the x-axis
- Time: data are sorted by the date/time of the samples and the time is shown on the x-axis
- TimeIndex: data are sorted by the date/time of the samples, the time is shown on the x-axis, and the points are evenly spaced
Additionally, the following series property can be set such that data is always sorted by the order it is added to the series, but the axis can display dates, times, keys, etc.:
The first step is to include the necessary namespaces
for the controls and add a new series.
Change the Axis Type
Below, we will change the axis type for an Individuals chart (named indChart in the
examples below). The process is similar for the other charts:
[Visual Basic]
' Change the axis type to display dates and times
indChart.XAxis.AxisLabelType = HorizontalAxisLabels.DateTime
' Change the axis type to display keys
indChart.XAxis.AxisLabelType = HorizontalAxisLabels.Key
[Visual C#]
// Change the axis type to display dates and times
indChart.XAxis.AxisLabelType = HorizontalAxisLabels.DateTime;
// Change the axis type to display keys
indChart.XAxis.AxisLabelType = HorizontalAxisLabels.Key;
After the series has been added, samples or subgroups may then be added to the
series. Adding samples and subgroups is discussed
here and here respectively. The resulting
chart from changing the axis types should look similar to the following: