Skip to main content

PieMapDashboardItem Class

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

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v24.1.Core.dll

NuGet Package: DevExpress.Dashboard.Core

Declaration

public class PieMapDashboardItem :
    GeoPointMapDashboardItemBase,
    IPieContext,
    IElementContainer

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.

MapsOverview_PieMap

The following documentation is available.

Example

The following code snippets show how to bind a Pie Map dashboard item to data in code.

using System;
using DevExpress.DashboardCommon;
using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Sql;
using DevExpress.XtraEditors;

namespace Dashboard_CreatePieMap {
    public partial class Form1 : XtraForm {
        public Form1() {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Dashboard dashboard = new Dashboard();

            DashboardSqlDataSource xmlDataSource = new DashboardSqlDataSource();
            xmlDataSource.ConnectionParameters =
                new XmlFileConnectionParameters(@"..\..\Data\DashboardEnergyStatictics.xml");
            SelectQuery sqlQuery = SelectQueryFluentBuilder
                .AddTable("Countries")
                .SelectColumns("Latitude", "Longitude", "Production", "EnergyType", "Country")
                .Build("Query 1");
            xmlDataSource.Queries.Add(sqlQuery);
            dashboard.DataSources.Add(xmlDataSource);

            PieMapDashboardItem pieMap = CreatePieMap(xmlDataSource);

            dashboard.Items.Add(pieMap);
            dashboardViewer1.Dashboard = dashboard;
        }

        private static PieMapDashboardItem CreatePieMap(DashboardSqlDataSource xmlDataSource)
        {
            PieMapDashboardItem pieMap = new PieMapDashboardItem();
            pieMap.DataSource = xmlDataSource;
            pieMap.DataMember = "Query 1";

            pieMap.Area = ShapefileArea.Europe;

            pieMap.Latitude = new Dimension("Latitude");
            pieMap.Longitude = new Dimension("Longitude");

            pieMap.Values.Add(new Measure("Production"));
            pieMap.Argument = new Dimension("EnergyType");

            pieMap.TooltipDimensions.Add(new Dimension("Country"));
            pieMap.Legend.Visible = true;
            return pieMap;
        }
    }
}
See Also