[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Charting Basics
   [Expand]Series Views
   [Expand]Chart Elements
   [Expand]Providing Data
   [Collapse]Data Representation
     Filter Series Data
     Sorting Data
     Data Aggregation
     Calculating Summaries
    [Expand]Financial Charting
     Using The Top-N Feature
     Work Time and Workday Configuration
     Empty Points
     Format Text Chart Elements
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Additional Resources
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Data Aggregation

Data Aggregation groups raw data points into points with a larger argument measurement unit. For example, if data points' arguments are measured in minutes, data aggregation can create points measured in hours or days to display fewer points.

When the data aggregation is enabled, the X-axis splits its range into intervals and automatically aggregates data for each interval using the aggregate function. For example, the title image shows chart data aggregated by Years using the Average aggregate function.


Data aggregation is available for the argument axis (X-axis) only.

Data aggregation is available depending on the X-Axis's scale type and scale mode (ScaleOptionsBase.ScaleMode). The X-axis can use one of the following modes for date-time and numeric scales to aggregate data:

Mode Description
ScaleMode.Automatic The chart control automatically defines the most optimal measurement unit for an axis based on the data set's values, the Chart Control's current size and zoom level. The ScaleGridOptionsBase.AggregateFunction property specifies the current aggregate function.
ScaleMode.Manual The measurement unit is specified manually using the DateTimeScaleOptions.MeasureUnit and DateTimeScaleOptions.MeasureUnitMultiplier properties for the date time axis, TimeSpanScaleOptions.MeasureUnit and TimeSpanScaleOptions.MeasureUnitMultiplier for the time-span axis, and NumericScaleOptions.MeasureUnit or NumericScaleOptions.CustomMeasureUnit for the numeric axis.
ScaleMode.Continuous Data aggregation is disabled for numeric, date-time, and time-span scales. This means an axis scale is not divided into intervals.

Use the following code to specify the X-axis's mode:

The following properties and types configure the axis scale's parameters:

Property Description
AxisXBase.QualitativeScaleOptions Provides access to the options that define the behavior of a scale when its type is qualitative.
QualitativeScaleOptions Contains settings for an axis scale when its data type is qualitative.
AxisBase.NumericScaleOptions Stores the options that define the behavior of a scale when its type is numeric.
NumericScaleOptions Contains settings for an axis scale when its data type is numeric.
AxisBase.DateTimeScaleOptions Stores the options that define the behavior of a scale when its type is date-time.
DateTimeScaleOptions Contains settings for an axis scale when its data type is date-time.
AxisBase.TimeSpanScaleOptions Stores the settings of a scale when its type is time-span.
TimeSpanScaleOptions Settings of a scale when its type is time-span.

The sections below detail the specifics of the aggregation feature using:

Expanded Aggregate Function

The ScaleGridOptionsBase.AggregateFunction property (available in ScaleMode.Automatic and ScaleMode.Manual scale modes) specifies the function that aggregates data on each interval on the X-axis. The AggregateFunction enumeration lists all available aggregate functions and the AggregateFunction property uses the enumeration's AggregateFunction.Average value by default.

The following table shows data aggregated using the AggregateFunction.Minimum and AggregateFunction.Sum functions in the ScaleMode.Automatic scale mode.

ScaleGridOptionsBase.AggregateFunction = AggregateFunction.Minimum ScaleGridOptionsBase.AggregateFunction = AggregateFunction.Sum

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.

Use the ChartControl.AxisScaleChanged (WebChartControl.AxisScaleChanged) event to obtain the axis' automatically calculated grid alignment and measurement unit values, when the scale mode is automatic. Moreover the event arguments contains the axis itself. This event is raised when the scale mode, measure unit, grid alignment or grid spacing of the axis scale has been changed.

When the Aggregate function is set to None, all series are grouped against point arguments and neither aggregate function is applied to data. This means that all points that have the same argument are displayed one over one. Set the ScaleOptionsBase.ScaleMode property to Continuous to disable aggregation.


When a series uses a summary function, the X-axis can't apply an aggregate function to data.

Expanded Qualitative Data Aggregation Specificity

The Chart Control aggregates qualitative data as follows: if several data rows have the same argument value, they are aggregated. The Chart Control does not aggregate qualitative data by default because the aggregate function is set to None. The following table contains the disabled and enabled aggregation samples:

AxisX.QualitativeScaleOptions.AggregateFunction = AggregateFunction.None; AxisX.QualitativeScaleOptions.AggregateFunction = AggregateFunction.Average;

Expanded Numeric Data Aggregation Specificity

The Chart Control does not aggregate numeric data by default because the numeric scale mode is set to ScaleMode.Continuous:

The NumericMeasureUnit enumeration lists the values that the NumericScaleOptions.MeasureUnit property uses in the ScaleMode.Manual scale mode. The following table shows the difference between the predefined Hundreds and Thousands measurement units:

NumericScaleOptions.MeasureUnit = NumericMeasureUnit.Hundreds NumericScaleOptions.MeasureUnit = NumericMeasureUnit.Thousands

If predefined measurement units are not applicable to the specified data source, use the NumericScaleOptions.CustomMeasureUnit property to specify a custom numeric measurement unit.

To use a custom Numeric measure unit for an Automatic scale mode, assign an object of a class implementing the INumericMeasureUnitsCalculator interface to the NumericScaleOptions.AutomaticMeasureUnitsCalculator property of AxisBase.NumericScaleOptions.

Expanded Date-time Data Aggregation Specificity

The X-axis's data aggregation is enabled by default because the date-time ScaleOptionsBase.ScaleMode is set to ScaleMode.Manual. In this mode, the DateTimeScaleOptions.GridAlignment and DateTimeScaleOptions.MeasureUnit properties that define the Chart control's grid appearance are available. The DateTimeScaleOptions.MeasureUnit also configures default Axis Labels' text format:

The DateTimeScaleOptions.MeasureUnit and DateTimeScaleOptions.MeasureUnitMultiplier properties determines the detail level for date-time values in the Manual scale mode. The DateTimeMeasurementUnit enumeration stores predefined measurement units. The following table shows data aggregated by DateTimeMeasurementUnit.Quarter and DateTimeMeasurementUnit.Year.

DateTimeScaleOptions.MeasureUnit = DateTimeMeasurementUnit.Quarter DateTimeScaleOptions.MeasureUnit = DateTimeMeasurementUnit.Year

To use a custom Date-Time measure unit for an Automatic scale mode, assign an object of a class implementing the IDateTimeMeasureUnitsCalculator interface to the DateTimeScaleOptions.AutomaticMeasureUnitsCalculator property of AxisBase.DateTimeScaleOptions.

Expanded See Also

Is this topic helpful?​​​​​​​