Skip to main content
All docs
V25.1
  • DataLabelCollection.HiddenLabels Property

    Returns the collection of hidden labels.

    Namespace: DevExpress.Spreadsheet.Charts

    Assembly: DevExpress.Spreadsheet.v25.1.Core.dll

    NuGet Package: DevExpress.Spreadsheet.Core

    Declaration

    IEnumerable<int> HiddenLabels { get; }

    Property Value

    Type Description
    IEnumerable<Int32>

    An enumerator that supports iteration over the collection.

    Remarks

    You can use the following API to hide individual data labels on a chart:

    The following example iterates through the HiddenLabels collection and displays all hidden labels:

    // Create a chart and specify its location.
    Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet["B2:C8"]);
    chart.TopLeftCell = worksheet.Cells["F2"];
    chart.BottomRightCell = worksheet.Cells["L15"];
    
    chart.Series[0].UseCustomDataLabels = true;
    // Display all data point values.
    chart.Series[0].CustomDataLabels.ShowValue = true;
    // Hide individual data labels.
    chart.Series[0].CustomDataLabels.SetVisibility(0, false);
    chart.Series[0].CustomDataLabels.SetVisibility(1, false);
    
    // Iterate through the collection
    // and display all hidden labels.
    var hiddenLabels = chart.Series[0].CustomDataLabels.HiddenLabels;
    foreach (int index in hiddenLabels)
        chart.Series[0].CustomDataLabels.FindByIndex(index).Hidden = false;
    
    See Also