[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Collapse]Charts Suite
   [Collapse]Chart Control
    [Expand]Getting Started
    [Expand]Fundamentals
    [Collapse]Providing Data
      Create a Series Manually
      Add Points to a Series Manually
      Bind a Series to a Data Source
      Define a Template for Automatic Series
      Series Scale Types
      Data Aggregation
      Data Filtering
      Colorizers
      Work Time and Workday Configuration
      Top N and Others
    [Expand]Chart Elements
    [Expand]Appearance Customization
    [Expand]End-User Features
    [Expand]Design-Time Features
    [Expand]Examples
    [Expand]Additional Resources
   [Expand]Chart3D Control
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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]eXpress Persistent Objects
[Expand]CodeRush
[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

This document explains the concept of data aggregation, as well as the steps needed to customize this feature for date-time and numeric data.

The document consists of the following sections.

Expanded Overview

Data aggregation is useful when your charts display a very large amount of data (e.g., thousands or even millions of data points), and when the objective is to display a quick aggregated view of this data.

The image below illustrates a chart with non-aggregated data.

When data aggregation is enabled in a chart control, the chart will split the entire X-Axis into intervals (according to the unit of measure value), and aggregate data for each interval.

Note

Data aggregation is available for the argument axis (X-axis) only, and neither the value axis (Y-axis) nor the secondary axes have this property.

The following image illustrates chart data aggregated by the year.

The data aggregation feature provides three scale options for both date-time and numeric data.

The sections below detail the specifics of using the aggregation feature for date-time and numeric data.

Expanded Date-time Data

For date-time data on the X-axis, data aggregation is enabled when the AxisX2D.DateTimeScaleOptions (AxisX3D.DateTimeScaleOptions, or RadarAxisX2D.DateTimeScaleOptions) property is set to either ManualDateTimeScaleOptions or AutomaticDateTimeScaleOptions.

You can use the ManualDateTimeScaleOptions.MeasureUnit property to determine the detail level for date-time values. Predefined units of measure for date-time scales are Millisecond, Second, Minute, Hour, Day, Week, Month, Quarter and Year.

The following table shows data aggregation for the measure unit set to Day and Month.

DateTimeScaleOptions.MeasureUnit = Day (default option) DateTimeScaleOptions.MeasureUnit = Month

As you can see from the images above, the ManualDateTimeScaleOptions.GridAlignment property is set to Year, though the property default Day value has not changed. This happens because the chart control provides automatic grid calculation (ManualDateTimeScaleOptions.AutoGrid is set to true) for the ManualDateTimeScaleOptions.

To see the default grid alignment, disable the ManualDateTimeScaleOptions.AutoGrid property.

Data for each interval on the X-axis is aggregated using the function specified by the AutomaticDateTimeScaleOptions.AggregateFunction property (available both in AutomaticDateTimeScaleOptions and ManualDateTimeScaleOptions). Although, by default, aggregate function is set to Average, it can be changed to Minimum, Maximum, Sum, etc.

The image below illustrates data aggregation in the Automatic scale options using the Sum function.

When the Aggregate function is set to None, all series are grouped against point arguments and the arithmetic operation is not applied to data.

If you wish to disable aggregation, set the AxisX2D.DateTimeScaleOptions (AxisX3D.DateTimeScaleOptions, or RadarAxisX2D.DateTimeScaleOptions) property to ContinuousDateTimeScaleOptions.

Note

To use a custom Date-Time measure unit in a Automatic scale mode, assign an object of a class implementing the IDateTimeMeasureUnitsCalculator interface to the AutomaticDateTimeScaleOptions.AutomaticMeasureUnitsCalculator property. Refer to the How to: Use a Custom Measure Units in Automatic Date-Time Scale Mode example to learn more.

Example

The following example illustrates date-time data aggregation.

Expanded Numeric Data

Data aggregation is enabled for the numeric scale type when the AxisX2D.NumericScaleOptions (AxisX3D.NumericScaleOptions, or CircularAxisX2D.NumericScaleOptions) property is set to either ManualNumericScaleOptions or AutomaticNumericScaleOptions.

The following image shows data aggregation in Automatic scale options using the default Average function.

If the Average aggregate function does not meet your business requirements, you can apply another function using the AutomaticNumericScaleOptions.AggregateFunction property (also available in ManualNumericScaleOptions).

In ManualNumericScaleOptions, you can specify any double value as a unit of measure in the ManualNumericScaleOptions.MeasureUnit property.

The following table shows data aggregation of a random function for a measure unit set to 100 and 1000.

MeasureUnit = 100, GridAlignment = 1000 MeasureUnit = 1000, GridAlignment = 1000

You can disable the numeric data aggregation in the same way as date-time data, using corresponding numeric options.

Note

To use a custom Numeric unit in a Automatic scale mode, assign an object of a class implementing the INumericMeasureUnitsCalculator interface to the AutomaticNumericScaleOptions.AutomaticMeasureUnitsCalculator property. Refer to the How to: Use a Custom Measure Unit in Automatic Numeric Scale Mode example to learn more.

Example

The following example illustrates numeric data aggregation.

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