The requested page is not available for the requested platform. You are viewing the content for Default platform.
All docs
V18.2
19.1 (preview)
18.2
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

PivotItem Class

A Pivot dashboard item that displays cross-tabular reports.

Declaration

export class PivotItem extends DataDashboardItem

Remarks

The Pivot dashboard item presents data using cross-tabular reports.

wdd-dashboard-items-pivot

The following documentation is available: Web Dashboard - Creating a Pivot.

Examples

The following example shows how to create the Pivot dashboard item, bind it to data and add to the existing dashboard.

Create data items (measures and dimensions) and use the DataItem.dataMember property to bind them to the existing data source's columns. Then use the created measures and dimensions in the dashboard item to bind it to data.

After you add the created dashboard item to the Dashboard.items collection, call the Dashboard.rebuildLayout method to rebuild the dashboard layout and display changes.

// Use the line below for a modular approach:
// import * as Model from 'devexpress-dashboard/model'
// Use the line below for an approach with global namespaces:
// var Model = DevExpress.Dashboard.Model;

// ...
public createPivotItem() { 
    // Create data items for the Pivot dashboard item.
    var pivotCategoryName = new Model.Dimension();
    pivotCategoryName.dataMember("CategoryName");
    var pivotProductName = new Model.Dimension();
    pivotProductName.dataMember("ProductName");
    var pivotCountry = new Model.Dimension();
    pivotCountry.dataMember("Country");
    var pivotFullName = new Model.Dimension();
    pivotFullName.dataMember("FullName");
    var pivotExtendedPrice = new Model.Measure();
    pivotExtendedPrice.dataMember("ExtendedPrice");

    // Create the Pivot dashboard item and bind it to data.
    var pivotItem = new Model.PivotItem();
    pivotItem.name('pivot');
    pivotItem.dataSource(sqlDataSource.componentName());
    pivotItem.dataMember(sqlDataSource.queries()[0].name());

    pivotItem.columns.push(pivotCountry, pivotFullName);
    pivotItem.rows.push(pivotCategoryName, pivotProductName); 
    pivotItem.values.push(pivotExtendedPrice);

    control.dashboard().items.push(pivotItem);
    // ...
    control.dashboard().rebuildLayout();
}

Inheritance

constructor

Initializes a new instance of the PivotItem class.

Declaration

constructor(dashboardItemJSON?: any, serializer?: DxDesigner.Analytics.Utils.ModelSerializer)

Optional Parameters

Type Name Default Description
any dashboardItemJSON null

A JSON object used for a dashboard deserialization. Do not pass this parameter directly.

DxDesigner.Analytics.Utils.ModelSerializer serializer null

An object used for a dashboard deserialization. Do not pass this parameter directly.

Properties

autoExpandColumnGroups Property

Declaration

autoExpandColumnGroups: KnockoutObservable<boolean>

Property Value

Type Description
KnockoutObservable<boolean>

autoExpandRowGroups Property

Declaration

autoExpandRowGroups: KnockoutObservable<boolean>

Property Value

Type Description
KnockoutObservable<boolean>

columnTotalsLocation Property

Declaration

columnTotalsLocation: KnockoutObservable<PivotColumnTotalsPosition>

Property Value

Type Description
KnockoutObservable<PivotColumnTotalsPosition>

columns Property

Declaration

columns: KnockoutObservableArray<Dimension>

Property Value

Type Description
KnockoutObservableArray<Dimension>

interactivityOptions Property

Declaration

interactivityOptions: FilterableDashboardItemInteractivityOptions

Property Value

Type Description
FilterableDashboardItemInteractivityOptions

layoutType Property

Declaration

layoutType: KnockoutObservable<PivotLayoutType>

Property Value

Type Description
KnockoutObservable<PivotLayoutType>

rowTotalsLocation Property

Declaration

rowTotalsLocation: KnockoutObservable<PivotRowTotalsPosition>

Property Value

Type Description
KnockoutObservable<PivotRowTotalsPosition>

rows Property

Declaration

rows: KnockoutObservableArray<Dimension>

Property Value

Type Description
KnockoutObservableArray<Dimension>

showColumnGrandTotals Property

Declaration

showColumnGrandTotals: KnockoutObservable<boolean>

Property Value

Type Description
KnockoutObservable<boolean>

showColumnTotals Property

Declaration

showColumnTotals: KnockoutObservable<boolean>

Property Value

Type Description
KnockoutObservable<boolean>

showRowGrandTotals Property

Declaration

showRowGrandTotals: KnockoutObservable<boolean>

Property Value

Type Description
KnockoutObservable<boolean>

showRowTotals Property

Declaration

showRowTotals: KnockoutObservable<boolean>

Property Value

Type Description
KnockoutObservable<boolean>

values Property

Declaration

values: KnockoutObservableArray<Measure>

Property Value

Type Description
KnockoutObservableArray<Measure>

valuesPosition Property

Declaration

valuesPosition: KnockoutObservable<PivotValuesPosition>

Property Value

Type Description
KnockoutObservable<PivotValuesPosition>

Methods

getInfo Method

For internal use.

Declaration

getInfo(): DxDesigner.Analytics.Utils.ISerializationsInfo

Returns

Type Description
DxDesigner.Analytics.Utils.ISerializationsInfo