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.

PieItem Class

A Pie dashboard item that displays a series of pies or donuts.

Declaration

export class PieItem extends ChartItemBase

Remarks

The Pie dashboard item displays a series of pies or donuts that represent the contribution of each value to the total.

wdd-dashboard-items-pies

The following documentation is available: Web Dashboard - Creating Pies.

Examples

The following example shows how to create the Pie 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 createPieItem() { 
    // Create data items for the Pie dashboard item.
    var pieCategoryName = new Model.Dimension();
    pieCategoryName.dataMember("CategoryName");
    var pieProductName = new Model.Dimension();
    pieProductName.dataMember("ProductName");
    var pieCountry = new Model.Dimension();
    pieCountry.dataMember("Country");
    var pieUnitPrice = new Model.Measure();
    pieUnitPrice.dataMember("UnitPrice");

    // Create the Pie dashboard item and bind it to data.
    var pieItem = new Model.PieItem();
    pieItem.name('pies');
    pieItem.dataSource(sqlDataSource.componentName());
    pieItem.dataMember(sqlDataSource.queries()[0].name());

    pieItem.arguments.push(pieCategoryName, pieProductName);
    pieItem.values.push(pieUnitPrice);
    pieItem.seriesDimensions.push(pieCountry);

    pieItem.interactivityOptions.isDrillDownEnabled(true);

    control.dashboard().items.push(pieItem);
    // ...
    control.dashboard().rebuildLayout();

}

Inheritance

ChartItemBase
PieItem

constructor

Initializes a new instance of the PieItem 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

labelContentType Property

Declaration

labelContentType: KnockoutObservable<PieValueType>

Property Value

Type Description
KnockoutObservable<PieValueType>

labelPosition Property

Specifies the position of data labels.

Declaration

labelPosition: KnockoutObservable<PointLabelPosition>

Property Value

Type Description
KnockoutObservable<PointLabelPosition>

A PointLabelPosition value that specifies the position of data labels.

pieType Property

Declaration

pieType: KnockoutObservable<string>

Property Value

Type Description
KnockoutObservable<string>

showPieCaptions Property

Declaration

showPieCaptions: KnockoutObservable<boolean>

Property Value

Type Description
KnockoutObservable<boolean>

tooltipContentType Property

Declaration

tooltipContentType: KnockoutObservable<PieValueType>

Property Value

Type Description
KnockoutObservable<PieValueType>

values Property

Declaration

values: KnockoutObservableArray<Measure>

Property Value

Type Description
KnockoutObservableArray<Measure>

Methods

getInfo Method

For internal use.

Declaration

getInfo(): DxDesigner.Analytics.Utils.ISerializationsInfo

Returns

Type Description
DxDesigner.Analytics.Utils.ISerializationsInfo