Skip to main content

LogarithmicRangeDistribution Class

Represents the logarithmic distribution of color ranges in a colorizer.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v24.2.dll

NuGet Package: DevExpress.Wpf.Map

Declaration

public class LogarithmicRangeDistribution :
    EquationRangeDistribution

Example

This example demonstrates how to customize a Choropleth colorizer’s range distribution.

It is possible using one of the following range distributions.

To use one of them, assign a required distribution to the ChoroplethColorizer.RangeDistribution property. Note that the ChoroplethColorizer.ApproximateColors property should be set to true.

<Window x:Class="RangeDistributions.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" 
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
        xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map" 
        Title="MainWindow" Height="600" Width="800">
    <Grid>

        <dxlc:LayoutControl>
            <dxlc:LayoutGroup Orientation="Vertical">
                <dxlc:LayoutGroup>
                    <dxlc:LayoutItem Label="Range Distribution" AddColonToLabel="True">
                        <dxe:ComboBoxEdit x:Name="rangeDistribution" SelectedIndexChanged="rangeDistribution_SelectedIndexChanged">
                            <dxm:LinearRangeDistribution x:Name="linear"/>
                            <dxm:LogarithmicRangeDistribution x:Name="logarithmic"/>
                            <dxm:ExponentialRangeDistribution x:Name="exponential"/>
                        </dxe:ComboBoxEdit>
                    </dxlc:LayoutItem>
                    <dxlc:LayoutItem Label="Factor Value" AddColonToLabel="True">
                        <dxe:SpinEdit x:Name="seFactor" EditValueChanged="factor_EditValueChanged" MaxValue="100" MinValue="0" Increment="0.1"/>
                    </dxlc:LayoutItem>
                </dxlc:LayoutGroup>
                <dxlc:LayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <dxm:MapControl>
                        <dxm:VectorLayer ToolTipPattern="{}{NAME}: ${GDP_MD_EST}" ToolTipEnabled="True">
                            <dxm:ShapefileDataAdapter FileUri="/Data/Countries.shp"/>
                            <dxm:VectorLayer.Colorizer>
                                <dxm:ChoroplethColorizer x:Name="colorizer" RangeDistribution="{Binding SelectedItem, ElementName=rangeDistribution}" ApproximateColors="True" 
                                                         RangeStops="0 3000 10000 18000 28000 44000 82000 185000 1000000 2500000 15000000">
                                    <dxm:ChoroplethColorizer.ValueProvider>
                                        <dxm:ShapeAttributeValueProvider AttributeName="GDP_MD_EST"/>
                                    </dxm:ChoroplethColorizer.ValueProvider>
                                    <dxm:ChoroplethColorizer.Colors>
                                        <Color>#5F8B95</Color>
                                        <Color>#799689</Color>
                                        <Color>#A2A875</Color>
                                        <Color>#CEBB5F</Color>
                                        <Color>#F2CB4E</Color>
                                        <Color>#F1C149</Color>
                                        <Color>#E5A84D</Color>
                                        <Color>#D6864E</Color>
                                        <Color>#C56450</Color>
                                        <Color>#BA4D51</Color>
                                    </dxm:ChoroplethColorizer.Colors>
                                </dxm:ChoroplethColorizer>
                            </dxm:VectorLayer.Colorizer>
                        </dxm:VectorLayer>
                    </dxm:MapControl>
                </dxlc:LayoutItem>
                <dxlc:LayoutItem>
                    <Label Content="{Binding Value, ElementName=factor}"/>
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
        </dxlc:LayoutControl>

    </Grid>
</Window>
See Also