wpf-devexpress-dot-xpf-dot-charts-dot-xyseries-98c9b99d.md
Gets or sets the color of the XY-series.
Namespace : DevExpress.Xpf.Charts
Assembly : DevExpress.Xpf.Charts.v25.2.dll
NuGet Package : DevExpress.Wpf.Charts
public SolidColorBrush Brush { get; set; }
Public Property Brush As SolidColorBrush
| Type | Description |
|---|---|
| SolidColorBrush |
A SolidColorBrush object that specifies the color of a series.
|
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));
Dim diagram As XYDiagram2D = CType(chart.Diagram, XYDiagram2D)
Dim series As AreaSeries2D = CType(diagram.Series(1), AreaSeries2D)
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];
// Opacity 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);
Dim diagram As XYDiagram2D = CType(chart.Diagram, XYDiagram2D)
Dim series As AreaSeries2D = CType(diagram.Series(1), AreaSeries2D)
' Opacity is set to 10%.
Dim color As Color = Color.FromArgb(10, series.Brush.Color.R, series.Brush.Color.G, series.Brush.Color.B)
series.Brush = New SolidColorBrush(color)
See Also