TrendSegmentColorizer Class
The colorizer that changes a line‘s color when a point value increases or decreases.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.dll
NuGet Package: DevExpress.Charts
Declaration
[TypeConverter(typeof(TrendSegmentColorizerTypeConverter))]
public class TrendSegmentColorizer :
SegmentColorizerBase,
ITrendSegmentColorizer,
ILegendItemProvider
Remarks
You can use the TrendSegmentColorizer to color the line series view and its descendants. To do this, assign the TrendSegmentColorizer object to the LineSeriesView.SegmentColorizer property.
Use the following properties to configure the TrendSegmentColorizer:
- The RisingTrendColor and FallingTrendColor properties allow you to specify colors for segments where a series point value increases or decreases. The line segment has FallingTrendColor if a point’s value does not change.
- The RisingTrendLegendText and TrendSegmentColorizer.FallingTrendLegendText properties define the text a legend shows for the rising and falling value segments. Use the ShowInLegend property to set whether the colorizer provides items for a legend.
Example
This example demonstrates how to use the TrendSegmentColorizer
to color a line series by its segments.
Create a
TrendSegmentColorizer
and assign it to the LineSeriesView.SegmentColorizer property.Specify the TrendSegmentColorizer.RisingTrendColor and TrendSegmentColorizer.FallingTrendColor properties to define colors that are used to draw rising and falling trend segments.
Define the TrendSegmentColorizer.RisingTrendLegendText and TrendSegmentColorizer.FallingTrendLegendText properties to specify text the legend uses to identify rising and falling trends.
TrendSegmentColorizer colorizer = new TrendSegmentColorizer();
colorizer.FallingTrendColor = Color.RoyalBlue;
colorizer.RisingTrendColor = Color.Firebrick;
colorizer.FallingTrendLegendText = "Temperature Decrease";
colorizer.RisingTrendLegendText = "Temperature Rise";
colorizer.ShowInLegend = true;
LineSeriesView lineSeriesView = chartControl.Series[0].View as LineSeriesView;
lineSeriesView.SegmentColorizer = colorizer;