ScaleGridOptionsBase.CustomAggregateFunction Property

Gets or sets the custom aggregate function callback that calculates the aggregated values.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v21.2.dll

Declaration

[Browsable(false)]
public CustomAggregateFunction CustomAggregateFunction { get; set; }

Property Value

Type Description
CustomAggregateFunction

The custom aggregate function callback.

Property Paths

You can access this nested property as listed below:

Show 24 property paths
Object Type Path to CustomAggregateFunction
Axis
.NumericScaleOptions.CustomAggregateFunction
Axis2D
.NumericScaleOptions.CustomAggregateFunction
Axis3D
.NumericScaleOptions.CustomAggregateFunction
AxisBase
.NumericScaleOptions.CustomAggregateFunction
AxisX
.NumericScaleOptions.QualitativeScaleOptions.CustomAggregateFunction
AxisX3D
.NumericScaleOptions.QualitativeScaleOptions.CustomAggregateFunction
AxisXBase
.NumericScaleOptions.QualitativeScaleOptions.CustomAggregateFunction
AxisY
.NumericScaleOptions.CustomAggregateFunction
AxisY3D
.NumericScaleOptions.CustomAggregateFunction
AxisYBase
.NumericScaleOptions.CustomAggregateFunction
GanttAxisX
.NumericScaleOptions.QualitativeScaleOptions.CustomAggregateFunction
PolarAxisX
.NumericScaleOptions.QualitativeScaleOptions.CustomAggregateFunction
RadarAxis
.NumericScaleOptions.CustomAggregateFunction
RadarAxisX
.NumericScaleOptions.QualitativeScaleOptions.CustomAggregateFunction
RadarAxisY
.NumericScaleOptions.CustomAggregateFunction
SecondaryAxisX
.NumericScaleOptions.QualitativeScaleOptions.CustomAggregateFunction
SecondaryAxisY
.NumericScaleOptions.CustomAggregateFunction
SwiftPlotDiagramAxis
.NumericScaleOptions.CustomAggregateFunction
SwiftPlotDiagramAxisX
.NumericScaleOptions.CustomAggregateFunction
SwiftPlotDiagramAxisXBase
.NumericScaleOptions.CustomAggregateFunction
SwiftPlotDiagramAxisY
.NumericScaleOptions.CustomAggregateFunction
SwiftPlotDiagramAxisYBase
.NumericScaleOptions.CustomAggregateFunction
SwiftPlotDiagramSecondaryAxisX
.NumericScaleOptions.CustomAggregateFunction
SwiftPlotDiagramSecondaryAxisY
.NumericScaleOptions.CustomAggregateFunction

Example

Follow the steps below to create an aggregate function.

View Example

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 };
    }
}
See Also