Skip to main content

Lesson 3 - Add Analytical Data to a Geographical Map

  • 4 minutes to read

The Map control can visualize data bound to geographical coordinates from various data sources (a database, an XML file, a list of records, etc.). This tutorial describes the steps required to create Pie charts on the map surface using data stored in an external XML file. This XML data file contains Olympic Games medal information.

To bind a map control to an XML data source, follow the instructions below:

Step 1. Add a Map Control

Step 2. Prepare a Vector Items Layer and Load Data

  • Add an empty VectorItemsLayer to the Map’s MapControl.Layers collection as follows:


  • To bind a data source to this layer, run the Data Source Wizard, as shown in the following image:


  • On the first Data Source Configuration Wizard page, set a data adapter as PieChartDataAdapter that allows the vector layer to generate Pie chart items. Then, click Next.


  • In the list of available technologies, select the XML Data item. Then, click Next.


  • On the next page, select the Loading a DataSet from XML item. Then, click Next.


  • On the final Data Source Configuration Wizard page, do the following:

    • Click the Load Xml… button.


    • In the invoked window, browse the rio2016.xml data source file and click Open.


      The rio2016.xml file is shipped with DevExpress demos and stored in the C:\Users\Public\Documents\DevExpress Demos 17.1\Components\Data directory by default.

    • Define data source members used to generate Pie chart items on the map as follows:


    • Finally, click Finish to complete the data source configuration.

Step 3. Configure Pie Chart Items

Step 4. Prepare a Colorizer

The next step is the Colorizer customization. For this, do the following:

The application should look like this if it is launched now :


Step 5. Add Legends

To add legends to the application, do the following:


Run the application to see the results.



A complete sample project is available in the DevExpress Code Examples database at

See Also