Back to Devexpress

MeasureCalculationWindowDefinition Class

dashboard-devexpress-dot-dashboardcommon-621fde9a.md

latest5.3 KB
Original Source

MeasureCalculationWindowDefinition Class

Serves as the base class for classes that specify a window definition used to perform calculations within different dashboard items.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
public abstract class MeasureCalculationWindowDefinition :
    ClonableModelBase<MeasureCalculationWindowDefinition>,
    IWindowDefinition
vb
Public MustInherit Class MeasureCalculationWindowDefinition
    Inherits ClonableModelBase(Of MeasureCalculationWindowDefinition)
    Implements IWindowDefinition

The following members return MeasureCalculationWindowDefinition objects:

Remarks

A window definition is used to apply calculations to measure values. To specify a window, create and initialize the required MeasureCalculationWindowDefinition class descendant and assign the resulting object to the Measure.WindowDefinition property.

Example

The code snippet adds a new measure to the Pivot dashboard item and specifies a window calculation to compute the difference between measure values across a window. The calculation is performed along columns of the Pivot dashboard item.

csharp
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
// ...
PivotDashboardItem pivotItem = dashboardViewer1.Dashboard.Items[pivotItemName] as PivotDashboardItem;
if (pivotItem != null)
{
    Measure extendedPrice = new Measure("Extended Price")
    {
        Name = "Diff",
        ShowGrandTotals = false
    };
    PivotWindowDefinition pivotWindowDefinition = new PivotWindowDefinition();
    pivotWindowDefinition.DefinitionMode = PivotWindowDefinitionMode.Columns;
    extendedPrice.WindowDefinition = pivotWindowDefinition;
    extendedPrice.Calculation = new DifferenceCalculation() { DifferenceType = DifferenceType.Absolute };
    pivotItem.Values.Add(extendedPrice);
}
vb
Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardWin
' ...
Dim pivotItem As PivotDashboardItem = TryCast(dashboardViewer1.Dashboard.Items(pivotItemName), PivotDashboardItem)
If pivotItem IsNot Nothing Then
    Dim extendedPrice As New Measure("Extended Price") With { _
        .Name = "Diff", _
        .ShowGrandTotals = False _
    }
    Dim pivotWindowDefinition As New PivotWindowDefinition()
    pivotWindowDefinition.DefinitionMode = PivotWindowDefinitionMode.Columns
    extendedPrice.WindowDefinition = pivotWindowDefinition
    extendedPrice.Calculation = New DifferenceCalculation() With {.DifferenceType = DifferenceType.Absolute}
    pivotItem.Values.Add(extendedPrice)
End If

Inheritance

Show 13 items

Object DevExpress.DashboardCommon.Native.ClonableModelBase<MeasureCalculationWindowDefinition> MeasureCalculationWindowDefinition CardWindowDefinition

ChartWindowDefinition

CustomItemWindowDefinition

GaugeWindowDefinition

GridWindowDefinition

PieWindowDefinition

PivotWindowDefinition

RangeFilterWindowDefinition

ScatterWindowDefinition

SpecificWindowDefinition

See Also

MeasureCalculationWindowDefinition Members

MeasureCalculation

Creating Window Calculations

DevExpress.DashboardCommon Namespace