This example demonstrates how to fill map shape contours with a specific color depending on GDP data from a shapefile (Countries.dbf, Countries.shp). To load data from a shapefile, use the ShapefileDataAdapter
.
To paint the map as in the image above, assign a ChoroplethColorizer
object to the VectorItemsLayer.Colorizer
property.
Then, specify an attribute from a shapefile used to define the shape color. To do this, create a ShapeAttributeValueProvider
object and specify its AttributeName
property. Then, assign the provider to the ChoroplethColorizer.ValueProvider
property.
Split attribute values into ranges that define color boundaries. To do this, populate the ChoroplethColorizer.RangeStops
collection with numeric range stops.
Populate the MapColorizer.ColorItems
colors with items that define colors used to paint shapes. The colorizer automatically associates each color with the specified data range to colorize map shapes.
If you want to display information on what each color means, create a Color Scale legend.
- How to load data from a KML file
- How to load SVG file content to the Map Control
- How to load data from a SQL geometry data-source
- How to configure a range distribution of ChoroplethColorizer
- How to colorize map contours loaded from Shapefiles using the graph colorizer
- How to colorize map shapes using the ShapeAttributeToColorKeyProvider class
- How to implement a custom colorizer
(you will be redirected to DevExpress.com to submit your response)