Back to Devexpress

ColorObjectColorizer Class

wpf-devexpress-dot-xpf-dot-charts-fa8c4f67.md

latest3.4 KB
Original Source

ColorObjectColorizer Class

A Colorizer that allows providing Color objects stored in Series.ColorDataMember to series points.

Namespace : DevExpress.Xpf.Charts

Assembly : DevExpress.Xpf.Charts.v25.2.dll

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public class ColorObjectColorizer :
    ChartColorizerBase
vb
Public Class ColorObjectColorizer
    Inherits ChartColorizerBase

Remarks

For more information about colorizers, refer to the Colorizers topic.

Example

To use the Color Object Colorizer, do the following.

Create a ColorObjectColorizer object and assign it to the Series.Colorizer property. Additional configuration is not required.

Note

This colorizer is used by default.

View Example

xaml
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" x:Class="ColorObjectColorizerExample.MainWindow"
        Title="MainWindow" Height="720" Width="1280">
    <Window.Resources>
        <XmlDataProvider x:Key="dataProvider" Source="Data/GDP.xml"/>
    </Window.Resources>

    <Grid DataContext="{Binding Source={StaticResource dataProvider}}">
        <dxc:ChartControl>
            <dxc:ChartControl.Titles>
                <dxc:Title Content="GDP for G20" HorizontalAlignment="Center"/>
            </dxc:ChartControl.Titles>
            <dxc:XYDiagram2D>
                <dxc:BarSideBySideSeries2D DisplayName="GDP" 
                                           DataSource="{Binding XPath=/G20HPIs/CountryStatistics}"
                                           ArgumentDataMember="Country" ValueDataMember="Product"
                                           ColorDataMember="NationalColor">
                    <dxc:BarSideBySideSeries2D.Colorizer>
                        <dxc:ColorObjectColorizer/>
                    </dxc:BarSideBySideSeries2D.Colorizer>
                </dxc:BarSideBySideSeries2D>
            </dxc:XYDiagram2D>
        </dxc:ChartControl>
    </Grid>

</Window>

Inheritance

Object DispatcherObject DependencyObject Freezable ChartDependencyObject ChartColorizerBase ColorObjectColorizer

See Also

ColorObjectColorizer Members

DevExpress.Xpf.Charts Namespace