.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.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.v19.2.Core.dll

Declaration

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

Property Value

Type Description
Boolean

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

Property Value

Type Description
Boolean

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

Property Value

Type Description
Boolean

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

Remarks

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.

Examples

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