April 2006
Beginner
1114 pages
98h 16m
English
Use the LeaderLines object to control the appearance of the lines connecting data labels to the data points in a series. LeaderLines are available only for pie chart types. Use the Series object’s LeaderLines property to get a reference to this object. LeaderLines has the following members:
Application Border Creator Delete Name Parent Select
You can select, delete, or change the appearance of LeaderLines in code. The following code adds data labels and leader lines to a pie chart and makes the leader lines bold:
Sub LeaderLineMembers( )
Dim chrt As Chart, b As Border
' Get the chart.
Set chrt = ActiveChart
' Make it a line chart
chrt.ChartType = xlPie
' Add data labels with leader lines.
chrt.ApplyDataLabels , , , True
Set b = chrt.SeriesCollection(1).LeaderLines.Border
b.Weight = xlThick
End SubLeader lines appear only if you drag the data labels away from the pie chart. You may have to manually drag the data labels away from the pie chart in order for the preceding code to work.
Read now
Unlock full access