Skip to main content

PointBasedSegmentColorizer.Direction Property

Gets or sets the direction that is used to distribute the point marker color.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public ColorDistributionDirection Direction { get; set; }

Property Value

Type Description
ColorDistributionDirection

The value that specifies the color distribution direction.

Available values:

Name Description
Forward

The point marker provides a color for the line/area segment that follows the marker.

Backward

The point marker provides a color for the line/area segment that precedes the marker.

Remarks

The following images show the Direction property in action:

Direction Image
ColorDistributionDirection.Forward Forward
ColorDistributionDirection.Backward Backward

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