How to remove legend from pie chart

B

Bon

Hello guys

Could anyone give me some hints on writng vba code for deleting legend
with zero value.
My chart is just shown percents There is a legend shown on the right
hand size.

I used the following lines to remove a pie chart with zero percent.

Set objChart = Me.oleLatestGraph.Object

For Each X In objChart.SeriesCollection(1).Points
'Use the following line for charts with just percents
If InStr(X.DataLabel.Text, "0%") > 0 Then
X.DataLabel.Delete
Else
With X.DataLabel.Font
..Size = "8"
..name = "Arial"
End With
End If
Next

Thanks in advance

Cheers
Bon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top