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

DataLabelBase.Separator Property

Gets or sets the string value that represents a separator for different items displayed in a data label.

Namespace: DevExpress.Spreadsheet.Charts

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


string Separator { get; set; }

Property Value

Type Description

A string used as a separator.


Use the Separator property to separate each item (such as the category name, series name, data point value or percentage value) in a data label with a comma, semicolon, new line character or any other text value you specify.


The example below demonstrates how to create a pie chart and adjust the display settings of its data labels. In particular, set the DataLabelBase.ShowCategoryName and DataLabelBase.ShowPercent properties to true to display the category name and percentage value in a data label at the same time. To separate these items, assign a new line character to the DataLabelBase.Separator property, so the percentage value will be automatically wrapped to a new line.

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

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.Pie, worksheet("B2:C7"))
chart.TopLeftCell = worksheet.Cells("E2")
chart.BottomRightCell = worksheet.Cells("K15")

' Display the category name and percentage.
Dim dataLabels As DataLabelOptions = chart.Views(0).DataLabels
dataLabels.ShowCategoryName = True
dataLabels.ShowPercent = True
dataLabels.Separator = Constants.vbLf

' Set the chart style.
chart.Style = ChartStyle.ColorGradient
' Hide the legend.
chart.Legend.Visible = False
' Set the angle of the first pie-chart slice.
chart.Views(0).FirstSliceAngle = 100
See Also