.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

ChartView.VaryColors Property

Gets or sets a value indicating whether each data marker in the series should have a different color.

Namespace: DevExpress.Spreadsheet.Charts

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


bool VaryColors { get; set; }
Property VaryColors As Boolean

Property Value

Type Description

true, if the same-series data markers are displayed in varied colors; otherwise, false.


By default, the slices in a pie or doughnut chart are varied, but you can turn this option off by setting the VaryColors property to false. As a result, the slices will be displayed as a single color instead of varied colors.


The example below demonstrates how to create a clustered column chart and automatically apply a different color to each data marker representing a data point on the chart. To vary colors of the same-series data markers point by point, set the ChartView.VaryColors property to true.

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

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, 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
' Hide the legend.
chart.Legend.Visible = False
See Also