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.v24.1.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
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.
Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location.
Chart 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;
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CustomDataLabels property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.