Average
- 2 minutes to read
The Average format rules allow you to highlight values above or below an average value. These format rules can be applied to measures or numeric dimensions.
Available Rules
The following condition types are supported for measures.
Format Condition | Description | Can be applied to |
---|---|---|
Above Average / Above or Equal Average | The Above Average/Above or Equal Average format conditions allow you to apply formatting to elements whose values are above/above or equal to the average. The following image displays a Grid dashboard item whose Extended Price values that are above average (~ $141K) filled in green: | Measures |
Below Average / Below or Equal Average | The Below Average/Below or Equal Average format conditions allow you to apply formatting to elements whose values are below/below or equal to the average. The following image displays a Grid dashboard item whose Extended Price values that are below average (~ $141K) filled in red: | Measures |
Create a Format Rule in the WinForms Designer
Click the measure’s menu button and select Add Format Rule | Average and choose the required type:
This action invokes the dialog that allows you to set a style for the selected format rule’s type:
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 Average:
Select the required format rule’s type:
This action opens the Average settings where you can select a format rule’s style:
Create a Format Rule in Code
Create the FormatConditionAverage class instance and specify the following settings to create the Average format condition in code:
- Specify the comparison logic by setting the FormatConditionAverage.AverageType property.
- Specify the required style settings applied to target elements using the FormatConditionStyleBase.StyleSettings property. You can change the color of dashboard item elements, font settings (AppearanceSettings) or add predefined icons (IconSettings).
Assign the resulting FormatConditionAverage object to the DashboardItemFormatRule.Condition property.
The following example shows how to apply conditional formatting to Grid cells: