Skip to main content
A newer version of this page is available. .

ScaleGridOptionsBase.CustomAggregateFunction Property

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

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.2.dll

NuGet Packages: DevExpress.Charts, DevExpress.WindowsDesktop.Charts

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
.TimeSpanScaleOptions .CustomAggregateFunction
Axis2D
.TimeSpanScaleOptions .CustomAggregateFunction
Axis3D
.TimeSpanScaleOptions .CustomAggregateFunction
AxisBase
.TimeSpanScaleOptions .CustomAggregateFunction
AxisX
.TimeSpanScaleOptions .CustomAggregateFunction
AxisX
.QualitativeScaleOptions .CustomAggregateFunction
AxisX3D
.TimeSpanScaleOptions .CustomAggregateFunction
AxisX3D
.QualitativeScaleOptions .CustomAggregateFunction
AxisXBase
.TimeSpanScaleOptions .CustomAggregateFunction
AxisXBase
.QualitativeScaleOptions .CustomAggregateFunction
AxisY
.TimeSpanScaleOptions .CustomAggregateFunction
AxisY3D
.TimeSpanScaleOptions .CustomAggregateFunction
AxisYBase
.TimeSpanScaleOptions .CustomAggregateFunction
GanttAxisX
.TimeSpanScaleOptions .CustomAggregateFunction
GanttAxisX
.QualitativeScaleOptions .CustomAggregateFunction
PolarAxisX
.TimeSpanScaleOptions .CustomAggregateFunction
PolarAxisX
.QualitativeScaleOptions .CustomAggregateFunction
RadarAxis
.TimeSpanScaleOptions .CustomAggregateFunction
RadarAxisX
.TimeSpanScaleOptions .CustomAggregateFunction
RadarAxisX
.QualitativeScaleOptions .CustomAggregateFunction
RadarAxisY
.TimeSpanScaleOptions .CustomAggregateFunction
SecondaryAxisX
.TimeSpanScaleOptions .CustomAggregateFunction
SecondaryAxisX
.QualitativeScaleOptions .CustomAggregateFunction
SecondaryAxisY
.TimeSpanScaleOptions .CustomAggregateFunction
SwiftPlotDiagramAxis
.TimeSpanScaleOptions .CustomAggregateFunction
SwiftPlotDiagramAxisX
.TimeSpanScaleOptions .CustomAggregateFunction
SwiftPlotDiagramAxisXBase
.TimeSpanScaleOptions .CustomAggregateFunction
SwiftPlotDiagramAxisY
.TimeSpanScaleOptions .CustomAggregateFunction
SwiftPlotDiagramAxisYBase
.TimeSpanScaleOptions .CustomAggregateFunction
SwiftPlotDiagramSecondaryAxisX
.TimeSpanScaleOptions .CustomAggregateFunction
SwiftPlotDiagramSecondaryAxisY
.TimeSpanScaleOptions .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 };
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomAggregateFunction property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also