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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel charts displaying series names as labels 1

Status
Not open for further replies.

cjashwell

MIS
Jul 10, 2001
80
GB
Hi,

Does anyone know if it's possible to display the series names as labels in Excel charts(I'm using Excel 2k under Win2k sp2)? It's straightforward to set the data labels to display Value or Point names, but I can't figure out how to display the names of the series' as labels.

Any suggestions, either in Excel itself or through VBA, gratefully received.

Thanks,
CJA
 
Anyone know anything about this? Data labels displaying Series names as opposed to Values or Point names??

I'm doing it manually by adding text boxes at the moment, but would love to know if there's a way of automating it. Please let me know if this post isn't clear.

Thanks,
CJA
 
Here's the data:

Exam Year NumberOfCandidates CandidatesAToE AvgNEWPointsEntry AvgNEWPoints_Student
2000 354 312 61.81 155.90
2001 362 316 57.64 142.85
2002 409 362 64.01 163.81
2003 440 394 63.86 169.48


I'm trying to make a column chart, and I want the series labels 'NumberOfCandidates', 'CandidatesAToE', etc, as labels *as well as* the Exam Year labels.

I can't format this post properly, but the five headings obviously match the five columns. The Major parts of the X axis are the Year categories (2000, 2001, etc).

Each series, then, has the tool tip format ' Series "NumberOfCandidates" Point "2000" Value: 354 ' for example.

If I select Value, I get the (eg) 354, and if I select label I get '2000', but what I want is "NumberOfCandidates", eg, as the label.

I hope this is clear. I'll check this thread again later tonight.

Many thanks,
CJA
 
I can only find a way to do it with code
Code:
Sub ReplaceDataLabelsWithSeriesName()
    With ActiveSheet.ChartObjects(1).Chart
        .ApplyDataLabels Type:=xlDataLabelsShowLabel
        For Each s In .SeriesCollection
            For Each p In s.Points
                p.DataLabel.Text = s.Name
            Next
        Next
    End With
End Sub
assuming that this is a embedded chart.

If its a Chart Sheet, change the second line to
Code:
    With ActiveChart
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi Skip,

Sorry not have got back to you about this earlier, and thank you very much for your assistance. Your code solution works great - so I am more than happy to star you!

Thanks again,
CJA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top