Skip to main content

PieMapItem Class

A Pie Map dashboard item that allows you to place pies on the map using geographical coordinates.

Declaration

export class PieMapItem extends GeoPointMapItemBase

Remarks

The Pie Map dashboard item allows you to place pies on the map using geographical coordinates. Each pie visualizes the contribution of each value to the total.

wdd-dashboard-items-pie-map

The following documentation is available: Web Dashboard - Creating Geo Point Maps.

Example

  • The following example shows how to create the Pie Map 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 createPieMapItem() { 
    // Create data items for the PieMap dashboard item.
    var pieMapEnergyType = new Model.Dimension();
    pieMapEnergyType.dataMember("EnergyType");
    var pieMapImport = new Model.Measure();
    pieMapImport.dataMember("Import");
    var pieMapLatitude = new Model.Dimension();
    pieMapLatitude.dataMember("Latitude");
    var pieMapLongitude = new Model.Dimension();
    pieMapLongitude.dataMember("Longitude");
    var pieMapProduction = new Model.Measure();
    pieMapProduction.dataMember("Production");


    // Create the PieMap dashboard item and bind it to data.
    var pieMapItem = new Model.PieMapItem();    
    pieMapItem.name('pieMap');
    pieMapItem.dataSource(excelDataSource.componentName());

    pieMapItem.latitude(pieMapLatitude);
    pieMapItem.longitude(pieMapLongitude);
    pieMapItem.area("Europe");

    pieMapItem.argument(pieMapEnergyType);
    pieMapItem.values.push(pieMapProduction);

    control.dashboard().items.push(pieMapItem);
    // ...
    control.dashboard().rebuildLayout();
}
See Also

constructor

Initializes a new instance of the PieMapItem class.

Declaration

constructor(
    modelJson?: any,
    serializer?: DevExpress.Analytics.Utils.ModelSerializer
)

Parameters

Name Type Description
modelJson any

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

serializer ModelSerializer

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

Properties

argument Property

Declaration

argument: ko.Observable<DevExpress.Dashboard.Model.Dimension>

Property Value

Type
Observable<Dimension>

isWeighted Property

Declaration

isWeighted: ko.Observable<boolean>

Property Value

Type
Observable<boolean>

legend Property

Declaration

legend: DevExpress.Dashboard.Model.MapLegend

Property Value

Type
MapLegend

values Property

Declaration

values: ko.ObservableArray<DevExpress.Dashboard.Model.Measure>

Property Value

Type
ObservableArray<Measure>

weightedLegend Property

Declaration

weightedLegend: DevExpress.Dashboard.Model.WeightedLegend

Property Value

Type
WeightedLegend