Skip to content

Fill map shape contours with a specific color depending on GDP data from a shapefile.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/winforms-map-create-choropleth-map-based-on-shapefile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Map for WinForms - Create a Choropleth Map Based on Shapes Loaded From a Shapefile

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.

Resulting map

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.

Files to Look At:

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Fill map shape contours with a specific color depending on GDP data from a shapefile.

Topics

Resources

License

Stars

Watchers

Forks