Skip to main content

Dimension.TopNOptions Property

Provides access to the Top N settings.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v23.2.Core.dll

NuGet Package: DevExpress.Dashboard.Core

Declaration

public DimensionTopNOptions TopNOptions { get; }

Property Value

Type Description
DimensionTopNOptions

A DimensionTopNOptions object that contains the Top N Values settings.

Remarks

Use the TopNOptions property to configure the Top N feature. This feature allows you to display a specified number of top or bottom dimension values, while ignoring the rest.

Set the DimensionTopNOptions.Enabled property to true to enable the Top N feature. Use the DimensionTopNOptions.Count property to specify the number of values to be displayed, and the DimensionTopNOptions.Mode property to specify whether the largest or smallest values should be selected.

To select the top or bottom values in the dimension, the Dashboard ranges all values by a measure specified by the DimensionTopNOptions.Measure property.

You can also introduce the “Others” value that aggregates the remaining dimension values. To do this, use the DimensionTopNOptions.ShowOthers property.

Note that when the Top N Values feature is enabled, dimension values are forcibly sorted by the specified measure, and the sort order is descending if top values are displayed and ascending if bottom values are displayed.

Example

The following code snippet shows how to display 3 sales persons with the largest Extended Price summaries.

Dimension salesPersonDimension = new Dimension("Sales Person");
Measure extendedPriceMeasure = new Measure("Extended Price");
//...
salesPersonDimension.TopNOptions.BeginUpdate();
salesPersonDimension.TopNOptions.Enabled = true;
salesPersonDimension.TopNOptions.Count = 3;
salesPersonDimension.TopNOptions.Measure = extendedPriceMeasure;
salesPersonDimension.TopNOptions.EndUpdate();
See Also