Dundas Chart for Windows Forms
Group(String,Double,IntervalType,Double,IntervalType,Series) Method
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > DataManipulator Class > Group Method : Group(String,Double,IntervalType,Double,IntervalType,Series) Method


formula
The formula(s) to be used for calculating the "grouped" data point values. Multiple formulas can be specified by using comma-separated values.
Grouping formula.
interval
Determines the grouping intervals.
Interval size.
intervalType
Determines the unit of measurement for the grouping intervals
Interval type.
intervalOffset
Determines the grouping interval offset.
Interval offset size.
intervalOffsetType
Determines the unit of measurement for the offset
Interval offset type.
inputSeries
Series object that will be grouped. It is cleared of its original data, and used to store the new data points.
Input data series.

Enterprise Edition Only Feature. Groups data using one or more formulas. The series that is grouped is cleared of its original data, and used to store the new data points.


Groups series points in the interval with offset.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub Group( _
   ByVal formula As String, _
   ByVal interval As Double, _
   ByVal intervalType As IntervalType, _
   ByVal intervalOffset As Double, _
   ByVal intervalOffsetType As IntervalType, _
   ByVal inputSeries As Series _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim formula As String
Dim interval As Double
Dim intervalType As IntervalType
Dim intervalOffset As Double
Dim intervalOffsetType As IntervalType
Dim inputSeries As Series
 
instance.Group(formula, interval, intervalType, intervalOffset, intervalOffsetType, inputSeries)
C#  
public void Group( 
   string formula,
   double interval,
   IntervalType intervalType,
   double intervalOffset,
   IntervalType intervalOffsetType,
   Series inputSeries
)

Parameters

formula
The formula(s) to be used for calculating the "grouped" data point values. Multiple formulas can be specified by using comma-separated values.
Grouping formula.
interval
Determines the grouping intervals.
Interval size.
intervalType
Determines the unit of measurement for the grouping intervals
Interval type.
intervalOffset
Determines the grouping interval offset.
Interval offset size.
intervalOffsetType
Determines the unit of measurement for the offset
Interval offset type.
inputSeries
Series object that will be grouped. It is cleared of its original data, and used to store the new data points.
Input data series.

Example

The following sample demonstrates how to group data in a series named "Sales" that stores sales values for January to December. Data will be grouped on a quarterly basis (every 3 months), and each point will result from the average sales for that quarter.
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

' Group data together on a quarterly basis, averaging all data points for each quarter. An offset of 15 days is used.
Chart1.DataManipulator.Group ("AVE", 3, Dundas.Charting.WinControl.IntervalType.Months, _
15, Dundas.Charting.WinControl.IntervalType.Days, Chart1.Series("Sales"))

Remarks

This method divides a series' data points into intervals and replaces the points in each interval with a new data point. The applied formula(s) determine the x and Y-values of these new points.

The interval, intervalOffset, intervalType and intervalOffsetType parameters determine which data points will be grouped together to create a single point. For example, let's assume that there are numerous data points that are plotted at random for an entire year. To group those points together on a monthly basis the interval would be one (1) and the intervalType would be "IntervalType.Month". To group points together on a monthly basis from the 15th day of every month (e.g. January 15 to February 15) the interval would be one (1), intervalType would be "IntervalType.Month", the intervalOffset would be fifteen (15) and the intervalOffsetType would be "IntervalType.Days".

The first formula is the default, and is applied to all Y-values that are not calculated using subsequent formulas. Formulas specified after the default formula must have a "value" prefix to identify which value they should be applied to. For example, an expression of "SUM, Y2:AVE, X:CENTER" means that an average of secondary Y-values will be calculated, a sum of all other Y-values will be calculated and the resulting data points will be plotted in the middle of their intervals. See Table1  for a listing of possible formulas and their descriptions.

Formulas for X-values merely determine where resulting data points will be plotted for the specified interval (e.g. along the left or right boundary of an interval or in the center of the interval). By default a formula of "FIRST" will be used for X-values (data point is plotted at the left of the interval).

To group data and preserve the original series use another definition of this function that has an outputSeries parameter.

All data points in the given series are grouped (i.e. it is not possible to group only some of a series' data points).

Empty data points will be ignored or treated as zeros, depending on the IgnoreEmptyPoints property (by default IgnoreEmptyPoints is True).

Formula   Description Used for X-Value
AVE The average value of all data points within the given interval. No.
MAX The maximum value of all data points within the given interval. No.
MIN The minimum value of all data points within the given interval. No.
SUM The total value of all data points within the given interval. No.
LAST The last value of all data points within the given interval. Yes. New data points are drawn at the right-most margin of intervals.
FIRST The first value of all data points within the given interval. Yes. New data points are drawn at the left-most margin of intervals.
HiLoOpCl Calculates the largest, smallest, opening and closing values. Opening value is the first value in the interval, while the closing value is the last value for the interval.

NOTE: this formula returns four Y-values, and should only be used for chart types that use four Y-values (e.g. Candlestick charts)
No.
HiLo The largest and smallest of all data points within the given interval.
 
NOTE: this formula returns two Y-values, and should only be used for chart type that use two Y-values (e.g. Bubble charts).
No.
Count The number of data points that have been grouped into one point. No.
DistinctCount The number of data points that have been grouped into one point. Data points that have the same primary Y-values are considered one point. No.
Variance The variance between all data points within the given interval. No.
Deviation The deviation between all data points within the given interval. No.
Center The deviation between all data points within the given interval. Yes. New data points are drawn at the center of intervals.

Table 1: Formulas.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.