Back to Devexpress

PointBasedSegmentColorizer.Direction Property

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

latest4.2 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public ColorDistributionDirection Direction { get; set; }
vb
Public Property Direction As ColorDistributionDirection

Property Value

TypeDescription
ColorDistributionDirection

The value that specifies the color distribution direction.

|

Available values:

NameDescription
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:

DirectionImage
ColorDistributionDirection.Forward
ColorDistributionDirection.Backward

Example

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

  • 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.

  • XAML

xaml
<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

PointBasedSegmentColorizer Class

PointBasedSegmentColorizer Members

DevExpress.Xpf.Charts Namespace