ChartObject.Style Property
Gets or sets the style to be applied to the chart.
Namespace: DevExpress.Spreadsheet.Charts
Assembly: DevExpress.Spreadsheet.v18.2.Core.dll
Declaration
Property Value
Type | Description |
---|---|
ChartStyle | A ChartStyle enumeration value specifying the chart style. |
Available values:
Name | Description |
---|---|
Gray | Specifies the monochromatic chart style that applies different shades of the first dark color defined by the document’s theme to each data series. |
GrayOutline | Specifies the monochromatic chart style that applies different shades of the first dark color defined by the document’s theme to each data series and specifies shape outlines. |
GrayGradient | Specifies the monochromatic chart style that applies different shades of the first dark color to each data series with a gradient effect defined by the document’s theme. |
GrayBevel | Specifies the monochromatic chart style that applies different shades of the first dark color defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
GrayArea | Specifies the monochromatic chart style that applies different shades of the first dark color defined by the document’s theme to each data series and specifies 20% tint of this color as the background color of the plot area. |
GrayDark | Specifies the monochromatic chart style that applies different shades of the first dark color defined by the document’s theme to each data series and uses this color to specify the heavy background fill of the chart area. |
Color | Specifies the colorful chart style that applies one of six accent colors defined by the document’s theme to each data series. |
ColorOutline | Specifies the colorful chart style that applies one of six accent colors defined by the document’s theme to each data series and specifies shape outlines. |
ColorGradient | Specifies the colorful chart style that applies one of six accent colors to each data series with a gradient effect defined by the document’s theme. |
ColorBevel | Specifies the colorful chart style that applies one of six accent colors defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
ColorArea | Specifies the colorful chart style that applies one of six accent colors to each data series and specifies 20% tint of the first dark color of the document’s theme as the background color of the plot area. |
ColorDark | Specifies the colorful chart style that applies one of six accent colors and shape effects to each data series and specifies the heavy background fill of the chart area using the first dark color of the document’s theme. |
Accent1 | Specifies the monochromatic chart style that applies different shades of Accent1 color defined by the document’s theme to each data series. |
Accent1Outline | Specifies the monochromatic chart style that applies different shades of Accent1 color defined by the document’s theme to each data series and specifies shape outlines. |
Accent1Gradient | Specifies the monochromatic chart style that applies different shades of Accent1 color to each data series with a gradient effect defined by the document’s theme. |
Accent1Bevel | Specifies the monochromatic chart style that applies different shades of Accent1 color defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
Accent1Area | Specifies the monochromatic chart style that applies different shades of Accent1 color defined by the document’s theme to each data series and specifies this color as the background color of the plot area. |
Accent1Dark | Specifies the monochromatic chart style that applies different shades of Accent1 color and shape effects to each data series and specifies the heavy background fill of the chart area using the first dark color of the document’s theme. |
Accent2 | Specifies the monochromatic chart style that applies different shades of Accent2 color defined by the document’s theme to each data series. |
Accent2Outline | Specifies the monochromatic chart style that applies different shades of Accent2 color defined by the document’s theme to each data series and specifies shape outlines. |
Accent2Gradient | Specifies the monochromatic chart style that applies different shades of Accent2 color to each data series with a gradient effect defined by the document’s theme. |
Accent2Bevel | Specifies the monochromatic chart style that applies different shades of Accent2 color defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
Accent2Area | Specifies the monochromatic chart style that applies different shades of Accent2 color defined by the document’s theme to each data series and specifies this color as the background color of the plot area. |
Accent2Dark | Specifies the monochromatic chart style that applies different shades of Accent2 color and shape effects to each data series and specifies the heavy background fill of the chart area using the first dark color of the document’s theme. |
Accent3 | Specifies the monochromatic chart style that applies different shades of Accent3 color defined by the document’s theme to each data series. |
Accent3Outline | Specifies the monochromatic chart style that applies different shades of Accent3 color defined by the document’s theme to each data series and specifies shape outlines. |
Accent3Gradient | Specifies the monochromatic chart style that applies different shades of Accent3 color to each data series with a gradient effect defined by the document’s theme. |
Accent3Bevel | Specifies the monochromatic chart style that applies different shades of Accent3 color defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
Accent3Area | Specifies the monochromatic chart style that applies different shades of Accent3 color defined by the document’s theme to each data series and specifies this color as the background color of the plot area. |
Accent3Dark | Specifies the monochromatic chart style that applies different shades of Accent3 color and shape effects to each data series and specifies the heavy background fill of the chart area using the first dark color of the document’s theme. |
Accent4 | Specifies the monochromatic chart style that applies different shades of Accent4 color defined by the document’s theme to each data series. |
Accent4Outline | Specifies the monochromatic chart style that applies different shades of Accent4 color defined by the document’s theme to each data series and specifies shape outlines. |
Accent4Gradient | Specifies the monochromatic chart style that applies different shades of Accent4 color to each data series with a gradient effect defined by the document’s theme. |
Accent4Bevel | Specifies the monochromatic chart style that applies different shades of Accent4 color defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
Accent4Area | Specifies the monochromatic chart style that applies different shades of Accent4 color defined by the document’s theme to each data series and specifies this color as the background color of the plot area. |
Accent4Dark | Specifies the monochromatic chart style that applies different shades of Accent4 color and shape effects to each data series and specifies the heavy background fill of the chart area using the first dark color of the document’s theme. |
Accent5 | Specifies the monochromatic chart style that applies different shades of Accent5 color defined by the document’s theme to each data series. |
Accent5Outline | Specifies the monochromatic chart style that applies different shades of Accent5 color defined by the document’s theme to each data series and specifies shape outlines. |
Accent5Gradient | Specifies the monochromatic chart style that applies different shades of Accent5 color to each data series with a gradient effect defined by the document’s theme. |
Accent5Bevel | Specifies the monochromatic chart style that applies different shades of Accent5 color defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
Accent5Area | Specifies the monochromatic chart style that applies different shades of Accent5 color defined by the document’s theme to each data series and specifies this color as the background color of the plot area. |
Accent5Dark | Specifies the monochromatic chart style that applies different shades of Accent5 color and shape effects to each data series and specifies the heavy background fill of the chart area using the first dark color of the document’s theme. |
Accent6 | Specifies the monochromatic chart style that applies different shades of Accent6 color defined by the document’s theme to each data series. |
Accent6Outline | Specifies the monochromatic chart style that applies different shades of Accent6 color defined by the document’s theme to each data series and specifies shape outlines. |
Accent6Gradient | Specifies the monochromatic chart style that applies different shades of Accent6 color to each data series with a gradient effect defined by the document’s theme. |
Accent6Bevel | Specifies the monochromatic chart style that applies different shades of Accent6 color defined by the document’s theme to each data series and specifies shape effects, like beveled edges and shadows. |
Accent6Area | Specifies the monochromatic chart style that applies different shades of Accent6 color defined by the document’s theme to each data series and specifies this color as the background color of the plot area. |
Accent6Dark | Specifies the monochromatic chart style that applies different shades of Accent6 color and shape effects to each data series and specifies the heavy background fill of the chart area using the first dark color of the document’s theme. |
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.
Example
The example below demonstrates how to create a chart and apply one of the predefined styles to it using the ChartObject.Style
property.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/winforms-spreadsheet-chart-api-e5222
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
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Style 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.