The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

ShapeFill.SetPatternFill(Color, Color, ShapeFillPatternType) Method

Sets the pattern fill for a drawing object's element.

Namespace: DevExpress.Spreadsheet.Drawings

Assembly: DevExpress.Spreadsheet.v19.2.Core.dll

Declaration

void SetPatternFill(
    Color foregroundColor,
    Color backgroundColor,
    ShapeFillPatternType patternType
)
Sub SetPatternFill(
    foregroundColor As Color,
    backgroundColor As Color,
    patternType As ShapeFillPatternType
)
void SetPatternFill(
    Color foregroundColor,
    Color backgroundColor,
    ShapeFillPatternType patternType
)
Sub SetPatternFill(
    foregroundColor As Color,
    backgroundColor As Color,
    patternType As ShapeFillPatternType
)
void SetPatternFill(
    Color foregroundColor,
    Color backgroundColor,
    ShapeFillPatternType patternType
)
Sub SetPatternFill(
    foregroundColor As Color,
    backgroundColor As Color,
    patternType As ShapeFillPatternType
)

Parameters

Name Type Description
foregroundColor Color

A Color object that specifies the foreground color of pattern fill.

backgroundColor Color

A Color object that specifies the background color of pattern fill.

patternType ShapeFillPatternType

A ShapeFillPatternType enumeration value that is a preset type of pattern fill.

Parameters

Name Type Description
foregroundColor Color

A Color object that specifies the foreground color of pattern fill.

backgroundColor Color

A Color object that specifies the background color of pattern fill.

patternType ShapeFillPatternType

A ShapeFillPatternType enumeration value that is a preset type of pattern fill.

Parameters

Name Type Description
foregroundColor Color

A Color object that specifies the foreground color of pattern fill.

backgroundColor Color

A Color object that specifies the background color of pattern fill.

patternType ShapeFillPatternType

A ShapeFillPatternType enumeration value that is a preset type of pattern fill.

Remarks

Use the SetPatternFill method to fill the drawing object background or its elements with a repeated pattern defined by the ShapeFillPatternType enumeration value.

Note

Currently, the SetPatternFill method has no effect on the visual appearance of a chart when the document is loaded in the SpreadsheetControl. However, the pattern fill settings can be accessed in code, exported in supported formats and visualized in Microsoft Excel.

Examples

The example below demonstrates how to create the 3-D clustered column chart and adjust its appearance. In particular, the code specifies how to customize the chart walls and floor by using the View3DOptions.BackWall, View3DOptions.SideWall and View3DOptions.Floor properties.

Worksheet worksheet = workbook.Worksheets["chartTask5"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.Column3DClustered, worksheet["B2:C8"]);
chart.TopLeftCell = worksheet.Cells["F2"];
chart.BottomRightCell = worksheet.Cells["L15"];

// Specify that each data point in the series has a different color.
chart.Views[0].VaryColors = true;
// Specify the series outline.
chart.Series[0].Outline.SetSolidFill(Color.AntiqueWhite);
// Hide the legend.
chart.Legend.Visible = false;

// Specify the side wall color.
chart.View3D.SideWall.Fill.SetSolidFill(Color.FromArgb(0xDC, 0xFA, 0xDD));
// Specify the pattern fill for the back wall.
chart.View3D.BackWall.Fill.SetPatternFill(Color.FromArgb(0x9C, 0xFB, 0x9F), Color.WhiteSmoke, DevExpress.Spreadsheet.Drawings.ShapeFillPatternType.DiagonalBrick);

SurfaceOptions floorOptions = chart.View3D.Floor;
// Specify the floor color.
floorOptions.Fill.SetSolidFill(Color.FromArgb(0xFA, 0xDC, 0xF9));
// Specify the floor border. 
floorOptions.Outline.SetSolidFill(Color.FromArgb(0xB4, 0x95, 0xDE));
floorOptions.Outline.Width = 1.25;
See Also