Back to Devexpress

PointBasedSegmentColorizer.Direction Property

corelibraries-devexpress-dot-xtracharts-dot-pointbasedsegmentcolorizer.md

latest5.5 KB
Original Source

PointBasedSegmentColorizer.Direction Property

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

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Appearance)]
public ColorDistributionDirection Direction { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Appearance)>
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.

csharp
LineSeriesView lineSeriesView = chartControl.Series[0].View as LineSeriesView;
lineSeriesView.MarkerVisibility = DevExpress.Utils.DefaultBoolean.True;

// Specify the colorizer that paints the series markers.
RangeColorizer rangeColorizer = new RangeColorizer();
rangeColorizer.Palette = new Palette("TemperaturePalette", new PaletteEntry[] { new PaletteEntry(Color.DarkBlue),
                                                                                new PaletteEntry(Color.SteelBlue),
                                                                                new PaletteEntry(Color.LightBlue),
                                                                                new PaletteEntry(Color.Yellow),
                                                                                new PaletteEntry(Color.OrangeRed) });

rangeColorizer.LegendItemPattern = "{V1: F0}°C — {V2: F0}°C";
rangeColorizer.RangeStops.AddRange(new double[] { -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30 });
chartControl.Series[0].Colorizer = rangeColorizer;

// Specify the colorizer that paints the line segments.
PointBasedSegmentColorizer segmentColorizer = new PointBasedSegmentColorizer();
segmentColorizer.Direction = ColorDistributionDirection.Forward;
lineSeriesView.SegmentColorizer = segmentColorizer;
vb
Dim lineSeriesView As LineSeriesView = CType(chartControl.Series(0).View,LineSeriesView)
lineSeriesView.MarkerVisibility = DevExpress.Utils.DefaultBoolean.True
' Specify the colorizer that paints the series markers.
Dim rangeColorizer As RangeColorizer = New RangeColorizer
rangeColorizer.Palette = New Palette("TemperaturePalette", New PaletteEntry() {New PaletteEntry(Color.DarkBlue), 
                                                                               New PaletteEntry(Color.SteelBlue), 
                                                                               New PaletteEntry(Color.LightBlue), 
                                                                               New PaletteEntry(Color.Yellow), 
                                                                               New PaletteEntry(Color.OrangeRed)})
rangeColorizer.LegendItemPattern = "{V1: F0}°C — {V2: F0}°C"
rangeColorizer.RangeStops.AddRange(New Double() {-40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30})
chartControl.Series(0).Colorizer = rangeColorizer
' Specify the colorizer that paints the line segments.
Dim segmentColorizer As PointBasedSegmentColorizer = New PointBasedSegmentColorizer
segmentColorizer.Direction = ColorDistributionDirection.Forward
lineSeriesView.SegmentColorizer = segmentColorizer

See Also

PointBasedSegmentColorizer Class

PointBasedSegmentColorizer Members

DevExpress.XtraCharts Namespace