HasPercentage Property

Microsoft Office Web Components Visual Basic

True if every data label for the specified series or chart currently displays its percentage value. The default value is False. This property is available only for pie, doughnut, and stacked charts. Read/write Boolean.

expression.HasPercentage

expression    Required. An expression that returns a ChDataLabels object.

Remarks

Data label components are always displayed in the following order: [SeriesName] [CategoryName] [Value] [BubbleSize] [Percentage].

Example

This example adds data labels showing percentage value to a series. Note that Charts(0) must refer to a pie, doughnut, or stacked chart.

Sub AddPercentabeLabels()
    Dim dl
    
    Set dl = ChartSpace1.Charts(0).SeriesCollection(0).DataLabelsCollection.Add
    
    ' Display percentage labels.
    dl.HasPercentage = True
End Sub