ColorListLegend Class
Represents a color legend as a list of colors.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v18.1.dll
Declaration
Remarks
To show this legend on a map, create an instance of the ColorListLegend class and add it to the MapControl.Legends. Then, specify the ItemsLayerLegend.Layer property of the instance. Note that a layer assigned to the legend should contain a colorizer.
The following image shows an instance of Color List Legend.
For more information, refer to Legends.
Example
To add a color legend listing the colors on the Map, create an instance of the ColorListLegend class and specify its ItemsLayerLegend.Layer property. Optionally, specify MapLegendBase.Header, MapLegendBase.Description and other properties.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-colorize-a-cartesian-map-using-a-key-color-colorizer-t176227
// Add a legend to the map.
map.Legends.Add(new ColorListLegend() {
Header = "Room Type",
Layer = hotelLayer
});
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ColorListLegend class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.