Skip to main content

Top-Bottom

  • 3 minutes to read

The Top-Bottom format conditions allow you to highlight a specific number of topmost/bottommost values. You can specify this number as an absolute or percent value.

Supported Types

The following condition types are supported for measures.

Format Condition

Description

Can be applied to

Top N

The Top N format condition allows you to apply formatting to elements whose values are ranked at the top. For instance, the following image displays a Grid dashboard item whose top 3 Extended Price values filled in green.

TopNFormatCondition

Measures

Bottom N

The Bottom N format condition allows you to apply formatting to elements whose values are ranked at the bottom. For instance, the following image displays a Grid dashboard item whose bottom 40 percent Extended Price values are filled in red.

BottomNFormatCondition

Measures

Create a Format Rule in the WinForms Designer

Click the measure’s menu button and select Add Format Rule | Top/Bottom and choose the required type:

This action invokes the dialog that allows you to configure a format rule and specify its style:

Here you can specify the number of top or bottom values to be displayed and whether to use a number or a percent to calculate top / bottom values.

Create a Format Rule in the Web Dashboard

In the Conditional Formatting section, click the plus button to add a new format rule:

Select the data item you want to format and set the condition type to Top/Bottom:

Select the required format rule’s type:

This action opens the Top/Bottom settings where you can configure a format rule and specify its style:

  • The Count option allows you to specify the number of top or bottom values to be displayed.
  • The Rank Type option is used to specify whether to use a number or a percent to calculate top / bottom values.

Create a Format Rule in Code

To create the Top-Bottom format condition in code, create the FormatConditionTopBottom class instance and specify the following settings.

Assign the resulting FormatConditionTopBottom object to the DashboardItemFormatRule.Condition property.

The following example shows how to apply conditional formatting to Grid cells:

View Example: How to Apply Conditional Formatting to Grid Cells