Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Expand]GIS Data
   [Expand]Vector Data
   [Expand]Visual Elements
   [Collapse]Examples
    [Expand]General
    [Expand]Map Image Data
    [Expand]GIS Data
    [Collapse]Vector Data
     [Expand]Providing Data
     [Collapse]Colorize Data
       How to: Colorize Map Contours Using the Choropleth Colorizer
       How to: Colorize Map Contours Using the Graph Colorizer
       How to: Colorize Map Items Using the Key Color Colorizer
       How to: Colorize Manually Added Shapes Using the Choropleth Colorizer
       How to: Implement a Custom Colorizer
     [Expand]Customize Data Appearance
    [Expand]Printing and Exporting
   [Expand]End-User Features
   [Expand]Product Information
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Colorize Map Contours Using the Choropleth Colorizer

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4691.

This example demonstrates how to paint each map contour in a specific color. To accomplish this, it is necessary to create a colorizer (choropleth or graph) and assign it to the VectorItemsLayer.Colorizer property.

For this colorizer, it is necessary to create a ShapeAttributeValueProvider object, specify the name of the shape attribute that contains a value to be colorized to its ShapeAttributeValueProvider.AttributeName property, and assign this value provider to the ChoroplethColorizer.ValueProvider property.

Then, split the entire data into ranges and add the required range stops to the DoubleCollection returned by the ChoroplethColorizer.RangeStops property.

Finally, add the desired set of colors to the GenericColorizerItemCollection<T> that is accessed from the ChoroplethColorizer.ColorItems property. The colorizer automatically associates each color with the specified data ranges.

Note

  • If you wish to display information on what each color means, create a Color Scale legend. To do this, create a ColorScaleLegend object and add it to the MapControl.Legends collection. In this legend, set its ItemsLayerLegend.Layer property to the previously created layer object and adjust other legend properties as required.
  • If you wish copy the shape file to your project, you should also copy the Countries.dbf file.

How would you rate this topic?​​​​​​​