Skip to main content

PointBasedSegmentColorizer Class

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

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.dll

NuGet Package: DevExpress.Charts

Declaration

[TypeConverter(typeof(PointBasedSegmentColorizerTypeConverter))]
public class PointBasedSegmentColorizer :
    SegmentColorizerBase,
    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.

Point Based Segment Colorizer

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;

Inheritance

Object
ChartElement
SegmentColorizerBase
PointBasedSegmentColorizer
See Also