Gets or sets the style to be applied to the chart.
A ChartStyle enumeration value specifying the chart style.
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.
The example below demonstrates how to create a chart and apply one of the predefined styles to it using the ChartObject.Style property.
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