[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  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]Charting Basics
   [Expand]Series Views
   [Expand]Chart Elements
   [Expand]Providing Data
   [Collapse]Data Representation
     Filtering Data
     Sorting Data
     Data Aggregation
     Calculating Summaries
    [Expand]Financial Charting
     Using The Top-N Feature
     Work Time and Workday Configuration
     Empty Points
     Histogram
   [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]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]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)

Using The Top-N Feature

This document describes how you can aggregate a number of series points into a single point.

The topic consists of the following sections.

Expanded Top-N Feature Overview

WinForms Charts support the Top-N feature, which allows you to get rid of Series Points with negligibly small values by either aggregating them into a single cumulative point, or by excluding them from the chart. Note that this does not affect the series points collection, and only has an effect on the chart's visual representation.

In general, this cumulative point (when made visible) behaves like an ordinary point (e.g., it can be exploded and displayed in the Legend where it can be accompanied by custom text).

Note

The Top-N feature is only in effect for a series whose data points contain only one value, because this value is used to determine which points to show. Thus, the Top-N feature is not available for series whose view type implies more than one value (e.g., in a Stock or Bubble chart).

Note

If a series contains data points with negative values, their absolute values are taken into account when calculating which points should be visible within the chart.

Expanded Using the Top-N Feature

To enable the Top-N feature within the SeriesBase.TopNOptions property, set the TopNOptions.Enabled property to true. Then choose the criteria upon which points are gathered in the cumulative point from the TopNOptions.Mode property. The available modes are described below.

  • Count

    When this mode is specified, only the first N points within the collection remain visible, while others are aggregated in the cumulative point. The number of points not to be included is specified from the TopNOptions.Count property.

    Note that with Bar, Line and Area Stacked Charts, values are displayed with stacking at shared series arguments, so the Top N points for multiple series (calculated independently for each series) can include points with the same arguments.

    The table below shows how this works for a Stacked Bar Chart with each series TopNOptions.Count property set to 3. Excluding the "Others" cumulative point, 6 values (3 per series) are shown for 5 arguments.

    Property values

    Resulting image

    TopNOptions.Enabled = false

    TopNOptions.Enabled = true

    TopNOptions.Count = 5

  • ThresholdValue

    When this mode is specified, you should define the value threshold that points need to overcome so that they are not included in the cumulative point. This is done using the TopNOptions.ThresholdValue property.

  • ThresholdPercent

    Similar to the previous mode, this parameter specifies the percentage threshold from the TopNOptions.ThresholdPercent property.

To choose whether or not the cumulative point should be visible, use the TopNOptions.ShowOthers property. Note that if values are represented as percentages (either in series point labels or in the legend), the overall percentage ignores the values of hidden points. The following image illustrates this.

Note that when this property is set to true, the cumulative point is displayed in the legend, and if arguments are displayed in the legend, its default argument is Others. You can specify a custom argument from the TopNOptions.OthersArgument property. Note that this property setting also affects this point's label.

To explode the cumulative point in a Pie or Doughnut chart, set the PieSeriesViewBase.ExplodeMode property to Others.

Expanded See Also

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