Series.CustomDataLabels Property
Provides access to a collection of data labels customized for specific data points or for the entire series.
Namespace: DevExpress.Spreadsheet.Charts
Assembly: DevExpress.Spreadsheet.v19.1.Core.dll
Declaration
Property Value
Type | Description |
---|---|
DataLabelCollection | A DataLabelCollection containing data labels with settings different from chart defaults. |
Remarks
To specify data label options for all series in a particular ChartView, use the ChartView.DataLabels property. The CustomDataLabels enables you to change data label settings for a specific series and for particular data points within the series. To change a data label for a specific data point, add an item with an index equal to the index of the data point to the data label collection. After that, change the properties of the added item as required.
Note
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")
' Display data labels for the second series.
chart.Series(1).CustomDataLabels.ShowValue = True
chart.Series(1).UseCustomDataLabels = True