Back to Devexpress

DrawOptions.Color Property

corelibraries-devexpress-dot-xtracharts-dot-drawoptions.md

latest5.3 KB
Original Source

DrawOptions.Color Property

Gets or sets the series view or series view point color when implementing custom drawing in the chart control.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public Color Color { get; set; }
vb
Public Property Color As Color

Property Value

TypeDescription
Color

A Color value that represents the color of either the series view or series view point.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Color
CustomDrawSeriesEventArgsBase

.LegendDrawOptions .Color

| | CustomDrawSeriesEventArgsBase |

.SeriesDrawOptions .Color

|

Remarks

Use the Color property to access and modify the color in the ChartControl.CustomDrawSeries or ChartControl.CustomDrawSeriesPoint event handler.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Color 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.

winforms-chart-draw-a-custom-legend-marker-for-a-series-point/CS/CustomSeriesPointDrawingSample/Form1.cs#L74

csharp
using (var fillBrush = isSelected ? (DXBrush)new DXHatchBrush(DXHatchStyle.DarkDownwardDiagonal,
                                                          e.LegendDrawOptions.Color,
                                                          e.LegendDrawOptions.ActualColor2)

winforms-chart-draw-a-custom-legend-marker-for-a-series/CS/CustomDrawingSample/Form1.cs#L78

csharp
using (var fillBrush = isSelected ? (DXBrush)new DXHatchBrush(DXHatchStyle.DarkDownwardDiagonal,
                                                          e.LegendDrawOptions.Color,
                                                          e.LegendDrawOptions.ActualColor2)

winforms-chart-draw-a-custom-legend-marker-for-a-series-point/VB/CustomSeriesPointDrawingSample/Form1.vb#L79

vb
Using graphics As DevExpress.Drawing.DXGraphics = DevExpress.Drawing.DXGraphics.FromImage(image)
    Using fillBrush = If(isSelected, CType(New DevExpress.Drawing.DXHatchBrush(DevExpress.Drawing.DXHatchStyle.DarkDownwardDiagonal, e.LegendDrawOptions.Color, e.LegendDrawOptions.ActualColor2), DevExpress.Drawing.DXBrush), CType(New DevExpress.Drawing.DXSolidBrush(e.LegendDrawOptions.Color), DevExpress.Drawing.DXBrush))
        graphics.FillRectangle(fillBrush, CustomSeriesPointDrawingSample.Form1.totalRect)

winforms-chart-draw-a-custom-legend-marker-for-a-series/VB/CustomDrawingSample/Form1.vb#L80

vb
Using graphics As DXGraphics = DXGraphics.FromImage(image)
    Using fillBrush = If(isSelected, CType(New DXHatchBrush(DXHatchStyle.DarkDownwardDiagonal, e.LegendDrawOptions.Color, e.LegendDrawOptions.ActualColor2), DXBrush), CType(New DXSolidBrush(e.LegendDrawOptions.Color), DXBrush))
        graphics.FillRectangle(fillBrush, totalRect)

See Also

ActualColor2

CustomDrawSeries

CustomDrawSeriesPoint

DrawOptions Class

DrawOptions Members

DevExpress.XtraCharts Namespace