The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.v19.1.Core.dll

Declaration

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

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.

Examples

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.

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);
}
See Also