[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].NET Core 3 Support
 [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
      Provide Data for the Drill Mode
      Best Practices: Display Large Data
      Series Scale Types
      Data Aggregation
      Calculate Summaries
      Data Filtering
      Colorizers
      Work Time and Workday Configuration
      Top N and Others
      Histogram
    [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

The Chart Control can use an aggregate function to group raw data source values and show aggregates as series points. You can use aggregation to show grouped data and decrease the number of visible points in a chart. Data aggregation is only available for argument Axes (x-axes).

Expanded Aggregation vs Summaries

In addition to Aggregation, the Chart Control provides Summaries that also allow you to group raw data values.

Aggregation Summary
Store Data Chart stores raw data source values. Chart stores summarized values.
Change Detail Level Chart re-calculates data in memory. Chart re-loads data from the data source.
Behave on Zoom If the automatic scale options are used, Chart recalculates value aggregates when it is zoomed. Chart does not re-calculate aggregated values when it is zoomed.
Memory Consumption High Low

Expanded Aggregation Basics

When the aggregation is enabled, the chart splits the x-axis into intervals (the x-axis measurement unit value defines the intervals), and uses an aggregate function to aggregate data for each interval.

The AggregateFunction enumeration lists the available aggregate functions:

  • Average (a default function)
  • Count
  • Financial (Use it for financial series.)
  • Histogram (See the Histogram topic for more information.)
  • Maximum
  • Minimum
  • Sum
  • Custom (Refer to the Create an Aggregate Function section for more information.)

Scale options assigned to the x-axis's ~ScaleOptions property store aggregation-related settings. You can use the following option types:

Options

Description

How to use

Automatic Date-Time and Automatic Numeric

The chart control defines the optimal measurement unit for an axis based on the data set's values, the Chart Control's current size, and zoom level.

For date-time axes. Assign a AutomaticDateTimeScaleOptions (see AutomaticDateTimeScaleOptions) object to the AxisX2D.DateTimeScaleOptions, AxisX3D.DateTimeScaleOptions or RadarAxisX2D.DateTimeScaleOptions property.<br>For numeric axes. Assign a AutomaticNumericScaleOptions (see AutomaticNumericScaleOptions) object to the AxisX2D.NumericScaleOptions, AxisX3D.NumericScaleOptions or CircularAxisX2D.NumericScaleOptions property.

Manual Date-Time and Manual Numeric

You can specify the axis measurement unit.

For date-time axes. Assign a ManualDateTimeScaleOptions (see ManualDateTimeScaleOptions) (or its descendant) object to the AxisX2D.DateTimeScaleOptions, AxisX3D.DateTimeScaleOptions or RadarAxisX2D.DateTimeScaleOptions property.<br>For numeric axes. Assign a ManualNumericScaleOptions (see ManualNumericScaleOptions) (or its descendant) object to the AxisX2D.NumericScaleOptions, AxisX3D.NumericScaleOptions or CircularAxisX2D.NumericScaleOptions property.

Qualitative

Chart aggregates point values if points have equal arguments.

For qualitative axes. Assign QualitativeScaleOptions (see QualitativeScaleOptions) to the AxisX2D.QualitativeScaleOptions or AxisX3D.QualitativeScaleOptions property.

Note

Axes that have the Continuous scale type (ContinuousDateTimeScaleOptions (see ContinuousDateTimeScaleOptions) and ContinuousNumericScaleOptions (see ContinuousNumericScaleOptions)) do not support aggregation.

Expanded Aggregate Date-Time Data

The following images show aggregated date-time data:

The examples below use an Average function to aggregate date-time data:

Automatic Mode

Manual Mode

The examples above use the following API members:

Member Description
AxisX2D.DateTimeScaleOptions Provides access to the options that define the behavior of a date-time X-scale when its mode is manual, automatic or continuous.
AutomaticDateTimeScaleOptions Contains settings for a date-time axis data when its scale mode is automatic.
ManualDateTimeScaleOptions Contains settings for a date-time axis data when its scale mode is manual.

Form a Custom Measurement Unit

You can use the ManualDateTimeScaleOptions.MeasureUnitMultiplier property with ManualDateTimeScaleOptions.MeasureUnit to specify a new measurement unit.

See also the following examples:

Expanded Aggregate Numeric Data

The following images show aggregated numeric data:

The examples below use an Average function to aggregate numeric data:

Automatic Mode

Manual Mode

The examples above use the following API members:

Member Description
AxisX2D.NumericScaleOptions Provides access to the options that define the behavior of a numeric X-scale when its mode is manual, automatic or continuous.
AutomaticNumericScaleOptions Contains settings for a numeric axis data when its scale mode is automatic.
ManualNumericScaleOptions Contains settings for a numeric axis data when its scale mode is manual.

See also the following examples:

Expanded Aggregate Qualitative Data

The following images show non-aggregated and aggregated qualitative data:

The example below uses a Sum function to aggregate qualitative data:

Expanded Aggregate an Individual Series's Data

You can apply different aggregate functions to series that are bound to the same x-axis. In this case, the aggregate function applied to a series has higher priority than the axis's aggregate function. To specify a series's aggregate function, use the XYSeries.AggregateFunction property.

The following example uses the Financial function to aggregate the Stock series and the Sum function - the Bar series:

Expanded Create a Custom Aggregate Function

The example below shows how to implement an aggregate function:

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