Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Providing Data
    [Expand]Providing Data
    [Collapse]Data Representation
      Filtering Data
      Sorting Data
      Calculating Summaries
      Using The Top-N Feature
      Work Time and Workday Configuration
      Empty Points Representation
      Data Aggregation
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Additional Resources
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap 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]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.

Important

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 for the date time axis and NumericScaleOptions.MeasureUnit or NumericScaleOptions.CustomMeasureUnit for the numeric axis.
ScaleMode.Continuous Data aggregation is disabled for numeric and date-time 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 Provides access to 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 Provides access to 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.

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.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T625114.

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.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1529.

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.

Important

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:

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

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T327427.

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.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T327370.

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?​​​​​​​