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+

ChartObject.Style Property

Gets or sets the style to be applied to the chart.

Namespace: DevExpress.Spreadsheet.Charts

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

Declaration

ChartStyle Style { get; set; }
Property Style As ChartStyle
ChartStyle Style { get; set; }
Property Style As ChartStyle
ChartStyle Style { get; set; }
Property Style As ChartStyle

Property Value

Type Description
ChartStyle

A ChartStyle enumeration value specifying the chart style.

Property Value

Type Description
ChartStyle

A ChartStyle enumeration value specifying the chart style.

Property Value

Type Description
ChartStyle

A ChartStyle enumeration value specifying the chart style.

Remarks

Use the Style property to apply one of the prebuilt styles defined by the ChartStyle enumeration members to the existing chart. Applying a style to the chart removes your custom formatting and sets the standard formatting determined by the selected style. Each style specifies the color of the data series, sets the chart's background fill and applies different shape effects and outlines to the chart.

The visual appearance of the chart to which the predefined style is applied depends on the current theme specified in a workbook. Every document's theme has a palette of colors which are used to set the colors of the chart. For example, you can select a colorful chart style which applies to each series one of the six accent colors, or you can specify a monochromatic design, which uses different shades of the same color for each series. The first series is painted a certain % shade of the specified accent color, and the last series is painted a certain % tint of that color. The intermediate colors are linearly interpolated by shade and tint of the selected color. You can change the accent colors by selecting another document's theme or creating the custom one.

Examples

The example below demonstrates how to create a chart and apply one of the predefined styles to it using the ChartObject.Style property.

Dim worksheet As Worksheet = workbook.Worksheets("chartTask3")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B2:D4"))
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")

' Set the chart style.
chart.Style = ChartStyle.Accent1Dark
See Also