Back to Devexpress

Using The Top-N Feature

aspnet-15957-components-chart-control-concepts-creating-charts-data-representation-using-the-top-n-feature.md

latest4.1 KB
Original Source

Using The Top-N Feature

  • Jun 16, 2022
  • 3 minutes to read

This topic describes how to aggregate multiple series points into a single point.

The topic consists of the following sections.

Top-N Feature Overview

DevExpress ASP.NET Charts support the Top-N feature, which allows you to eliminate 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 how the chart is displayed.

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 available for a series whose data points contain one value, because this value is used to determine which points to show. Thus, the Top-N feature is not available for series view types that utilize more than one value (e.g., Stock or Bubble).

If a series contains data points with negative values, their absolute values are used to calculate which points are visible within the chart.

Using the Top-N Feature

To enable the Top-N feature within the SeriesBase.TopNOptions property, set the TopNOptions.Enabled property to true. Then, use the TopNOptions.Mode property to specify how to determine the number of Top-N series points to display. The available modes are described below.

  • Count

  • ThresholdValue

  • ThresholdPercent

To specify whether or not the cumulative point is visible, use the TopNOptions.ShowOthers property. Note that if values are displayed as percentages (either in series point labels or in the legend), the overall percentage ignores the values of hidden points - as shown in the following image.

If the TopNOptions.OthersArgument property is set to true and arguments are included in the legend item and series label text patterns, the legend displays the cumulative point and series label with the Others argument. You can use this property to change the argument displayed for the cumulative point.

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

See Also

Filter Series Data

Sorting Data

Calculating Summaries

Empty Points