Skip to main content
A newer version of this page is available. .

PointBasedSegmentColorizer Class

The colorizer that uses the point marker colors to paint line/area segments.

Namespace: DevExpress.Xpf.Charts

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Charts, DevExpress.Wpf.Charts

Declaration

public class PointBasedSegmentColorizer :
    SegmentColorizerBase,
    IPointSegmentColorizer

Remarks

You can apply the Point Based Segment colorizer to the line/area series and their descendants. To do this, assign the PointBasedSegmentColorizer object to the series’s SegmentColorizer property.

The SeriesPoint.Color property specifies the point marker and its adjacent segment’s color. You can define SeriesPoint.Brush directly or use a point colorizer.

The PointBasedSegmentColorizer class introduces the PointBasedSegmentColorizer.Direction property to specify the direction that is used to distribute the point marker color.

Example

This example demonstrates how to use the PointBasedSegmentColorizer to paint a line series by its segments.

Point Based Segment Colorizer

  • Specify the point colorizer that defines marker colors.

  • Create a PointBasedSegmentColorizer and assign it to the series’s SegmentColorizer property.

  • Use the PointBasedSegmentColorizer.Direction property to define the direction the point marker should use to distribute its color.

<dxc:ChartControl x:Name="chartControl">
    <!--...-->
    <dxc:XYDiagram2D>
        <!--...-->
        <dxc:LineSeries2D  DisplayName="Temperature" 
                           DataSource="{Binding}" 
                           ArgumentDataMember="Date" 
                           ValueDataMember="Temperature" 
                           ColorDataMember="Temperature" 
                           MarkerVisible="True">
            <!-- Specify the colorizer to paint point markers. -->
            <dxc:LineSeries2D.Colorizer>
                <dxc:RangeColorizer RangeStops="-40 -30 -20 -15 -10 -5 0 5 10 15 20 30" 
                                    LegendTextPattern="{}{V1:F0}°C — {V2:F0}°C">
                    <dxc:RangeColorizer.Palette>
                        <dxc:CustomPalette>
                            <dxc:CustomPalette.Colors>
                                <Color A="255" R="0"   G="0"   B="139"/>
                                <Color A="255" R="173" G="216" B="230"/>
                                <Color A="255" R="255" G="69"  B="0"/>
                            </dxc:CustomPalette.Colors>
                        </dxc:CustomPalette>
                    </dxc:RangeColorizer.Palette>
                </dxc:RangeColorizer>
            </dxc:LineSeries2D.Colorizer>
            <!-- Specify the colorizer to paint the line series segments. -->
            <dxc:LineSeries2D.SegmentColorizer>               
                <dxc:PointBasedSegmentColorizer x:Name="segmentColorizer" Direction="Backward"/>
            </dxc:LineSeries2D.SegmentColorizer>
        </dxc:LineSeries2D>
    </dxc:XYDiagram2D>
</dxc:ChartControl>
See Also