Skip to main content
A newer version of this page is available. .
All docs
V21.1
.NET Framework 4.5.2+

ChartObject.ColorPalette Property

Returns or specifies a color palette for the chart. Applies only to Excel 2016 charts.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v21.1.Core.dll

Declaration

ChartColorPalette ColorPalette { get; set; }

Property Value

Type Description
ChartColorPalette

An enumeration member that specifies the chart’s color palette.

Remarks

Use the ColorPalette property to change chart colors. These colors depend on the document theme and change when another theme is applied to the workbook. The ChartObject.Style property defines the chart style (a combination of format options and layout settings).

The example below demonstrates how to create a waterfall chart and specify its colors and style.

Change the chart style and color palette for a waterfall chart

// Create a waterfall chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.Waterfall, worksheet["B2:C7"]);
chart.TopLeftCell = worksheet.Cells["E2"];
chart.BottomRightCell = worksheet.Cells["L17"];

// Hide the major gridlines for the value axis.
chart.PrimaryAxes[1].MajorGridlines.Visible = false;

// Specify series options.
var options = chart.Series[0].LayoutOptions.Waterfall;
// Display connector lines.
options.ShowConnectorLines = true;
// Set the third data point as the total.
options.SubtotalDataPoints.Add(2);
// Set the last data point as the total.
options.SubtotalDataPoints.Add(5);

// Specify the chart style.
chart.Style = ChartStyle.Style3;
// Change chart colors.
chart.ColorPalette = ChartColorPalette.Colorful4;

// Add the chart title.
chart.Title.Visible = true;
chart.Title.SetValue("Income Statement");
See Also