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

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();

}

constructor

Initializes a new instance of the PieItem class.

Declaration

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

Optional Parameters

Name Type Default Description
dashboardItemJSON any null

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

serializer DxDesigner.Analytics.Utils.ModelSerializer null

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

Properties

labelContentType Property

Declaration

labelContentType: ko.Observable<PieValueType>

Property Value

Type Description
ko.Observable<PieValueType>

labelPosition Property

Specifies the position of data labels.

Declaration

labelPosition: ko.Observable<PointLabelPosition>

Property Value

Type Description
ko.Observable<PointLabelPosition>

A PointLabelPosition value that specifies the position of data labels.

pieType Property

Declaration

pieType: ko.Observable<string>

Property Value

Type Description
ko.Observable<string>

showPieCaptions Property

Declaration

showPieCaptions: ko.Observable<boolean>

Property Value

Type Description
ko.Observable<boolean>

tooltipContentType Property

Declaration

tooltipContentType: ko.Observable<PieValueType>

Property Value

Type Description
ko.Observable<PieValueType>

values Property

Declaration

values: ko.ObservableArray<Measure>

Property Value

Type Description
ko.ObservableArray<Measure>

Methods

getInfo Method

For internal use.

Declaration

getInfo(): DxDesigner.Analytics.Utils.ISerializationInfoArray

Returns

Type Description
DxDesigner.Analytics.Utils.ISerializationInfoArray