Customizing Chart Elements > Programming ChartLabels |
For more information, see Using ChartLabels.
A ChartLabelobject defines an independent rectangular region which can be attached to a chart. The ChartLabelscollection contains all of the chart labels defined for a particular chart.
To create a ChartLabel object, call the Add method:
Dim label As Object
Set label = Chart2D1.ChartLabels.Add
The Remove method removes a ChartLabel from the collection:
Chart2D1.ChartLabels.Remove 1
You can pass either the chart label's index or its name to Remove.
To quickly remove all ChartLabels from the collection, use the RemoveAll() method:
Chart2D1.ChartLabels.RemoveAll()