A newer version of this page is available.
Switch to the current version.
GroupInfo Class
Storage of information about the values that should be aggregated into a series point.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v18.2.dll
Declaration
[RuntimeObject]
public sealed class GroupInfo
<RuntimeObject>
Public NotInheritable Class GroupInfo
Examples
Set the CustomAggregateFunction class descendant object to the ScaleGridOptionsBase.CustomAggregateFunction property to use the custom aggregate function. Note that the ScaleGridOptionsBase.AggregateFunction property should be set to Custom.
NOTE
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-implement-a-custom-aggregate-function-t625114
private void Form1_Load(object sender, EventArgs e) {
Series series = chartControl.Series["Random Data"];
series.DataSource = GenerateData(100_000);
series.ArgumentDataMember = "Argument";
series.ValueDataMembers.AddRange("Value", "Value", "Value", "Value");
XYDiagram diagram = chartControl.Diagram as XYDiagram;
diagram.AxisX.DateTimeScaleOptions.AggregateFunction = AggregateFunction.Custom;
diagram.AxisX.DateTimeScaleOptions.CustomAggregateFunction = new OhlcAggregateFunction();
}
class OhlcAggregateFunction : CustomAggregateFunction {
public override double[] Calculate(GroupInfo groupInfo) {
double open = groupInfo.Values1.First();
double close = groupInfo.Values1.Last();
double high = Double.MinValue;
double low = Double.MaxValue;
foreach (double value in groupInfo.Values1) {
if (high < value) high = value;
if (low > value) low = value;
}
return new double[] { high, low, open, close };
}
}
Inheritance
Object
GroupInfo
See Also
Feedback