Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Label Pie Chart Legend

Status
Not open for further replies.

Dyceware

Programmer
Joined
Jul 19, 2005
Messages
2
Location
US
Hi, I've been working with MSGraph for a week now. Making line charts and the such gives me no problems, but the pie charts are another matter.

Code:
OMetResults.ChartSpace1.Clear
OMetResults.ChartSpace1.Charts.Add

' Create our series. There will be at most two (one project and the other)
OMetResults.ChartSpace1.Charts(0).SeriesCollection.Add
    
   
    
OMetResults.ChartSpace1.Charts(0).SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, Metrics.CrossLbl(10) & Chr(9) & Metrics.MetricLbl(10).Caption

OMetResults.ChartSpace1.Charts(0).Type = chChartTypePie
       
OMetResults.ChartSpace1.Charts(0).HasLegend = True

As is, the code will display the legend except it will label the legend items simply as "1" and "2". Which is not descriptive at all. I would like to be able to set each item's name to a simple string like "Banana" or whatever.

How do I do this?
 
Welcome to Tek-Tips. Please read faq222-2244 to find guidelines on forum usage, including guidelines on not 'bumping' in less than 2 hours. People may think you are being impatient.

For this question, you don't appear to have set the Legend property:

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top