XYSeries.Brush Property
Gets or sets the color of the XY-series.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v24.2.dll
NuGet Package: DevExpress.Wpf.Charts
#Declaration
public SolidColorBrush Brush { get; set; }
#Property Value
Type | Description |
---|---|
Solid |
A Solid |
#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];
// 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);
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Brush property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.