Back to Devexpress

PointBasedSegmentColorizer Class

corelibraries-devexpress-dot-xtracharts-ea8b8432.md

latest5.7 KB
Original Source

PointBasedSegmentColorizer Class

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

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class PointBasedSegmentColorizer :
    SegmentColorizerBase,
    IPointSegmentColorizer
vb
Public Class PointBasedSegmentColorizer
    Inherits SegmentColorizerBase
    Implements IPointSegmentColorizer

Remarks

You can use the PointBasedSegmentColorizer to paint the line series view and its descendants. To do this, assign the PointBasedSegmentColorizer object to the LineSeriesView.SegmentColorizer property.

The SeriesPoint.Color property specifies the point marker and its adjacent segment’s color. You can define the SeriesPoint.Color 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.

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

Inheritance

Object ChartElement SegmentColorizerBase PointBasedSegmentColorizer

See Also

PointBasedSegmentColorizer Members

DevExpress.XtraCharts Namespace