XYSeries.Brush Property

Gets or sets the color of the XY-series.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v20.1.dll

Declaration

public SolidColorBrush Brush { get; set; }
Public Property Brush As SolidColorBrush

Property Value

Type Description
SolidColorBrush

A SolidColorBrush object that specifies the color of a series.

Remarks

Use the following code to set the Brush property:

In Markup:

<dxc:AreaSeries2D  ArgumentScaleType="Numerical"  Brush="#43a047">
</dxc:AreaSeries2D>

In Code-Behind:

XYDiagram2D diagram = (XYDiagram2D)chart.Diagram;
AreaSeries2D series = (AreaSeries2D)diagram.Series[1];
series.Brush = new SolidColorBrush(Color.FromArgb(100, 255, 0, 0));

The Brush property does not support Opacity. You can use Color to set the opacity as follows:

XYDiagram2D diagram = (XYDiagram2D)chart.Diagram;
AreaSeries2D series = (AreaSeries2D)diagram.Series[1];
// Opasity is set to 10%.
Color color = Color.FromArgb(10, series.Brush.Color.R, series.Brush.Color.G, series.Brush.Color.B); 
series.Brush = new SolidColorBrush(color);
See Also