TrendSegmentColorizer Class
The colorizer that changes a line/area’s color when a point value increases or decreases.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v24.1.dll
NuGet Package: DevExpress.Wpf.Charts
Declaration
public class TrendSegmentColorizer :
SegmentColorizerBase,
ITrendSegmentColorizer,
ILegendItemsProvider
Remarks
You can apply the Trend Segment colorizer to the line/area series and their descendants. To do this, assign the TrendSegmentColorizer object to the series’s 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/area segment has FallingTrendColor if a point’s value does not change.
The RisingTrendLegendText and 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 series’s 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.
<dxc:ChartControl>
<!--...-->
<dxc:XYDiagram2D>
<!--...-->
<dxc:LineSeries2D DisplayName="Temperature"
DataSource="{Binding}"
ArgumentDataMember="Date"
ValueDataMember="Temperature">
<dxc:LineSeries2D.SegmentColorizer>
<dxc:TrendSegmentColorizer RisingTrendColor="Firebrick"
FallingTrendColor="RoyalBlue"
RisingTrendLegendText = "Temperature Rise"
FallingTrendLegendText = "Temperature Decrease"
ShowInLegend="True"/>
</dxc:LineSeries2D.SegmentColorizer>
</dxc:LineSeries2D>
</dxc:XYDiagram2D>
</dxc:ChartControl>