corelibraries-devexpress-dot-xtracharts-dot-trendsegmentcolorizer-b34ab9a2.md
Gets or sets the value that specifies whether the colorizer should provide items for the legend.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool ShowInLegend { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property ShowInLegend As Boolean
| Type | Description |
|---|---|
| Boolean |
true , if the legend should show the colorizer items; otherwise, false.
|
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;
Dim colorizer As TrendSegmentColorizer = New TrendSegmentColorizer
colorizer.FallingTrendColor = Color.RoyalBlue
colorizer.RisingTrendColor = Color.Firebrick
colorizer.FallingTrendLegendText = "Temperature Decrease"
colorizer.RisingTrendLegendText = "Temperature Rise"
colorizer.ShowInLegend = true
Dim lineSeriesView As LineSeriesView = CType(chartControl.Series(0).View,LineSeriesView)
lineSeriesView.SegmentColorizer = colorizer
See Also