Label at the end of Stacked Bar Pivot Chart

PopSix

New Member
Joined
Aug 31, 2010
Messages
8
I have a stacked bar pivot chart. I would like to add a label or textbox at the end of each of the bar. How do I find and reference the x-y coordinates for the end each bar?

My VBA is limited, but growing. Any snippet or code example would be great.

Thanks.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I take it data labels are no good to you for some reason?
 
Upvote 0
Sorry, it appears the reply I thought I posted yesterday never got through.
If you use the data labels, you can alter the text in them - for example:
Code:
    Dim ser As Series
    Dim n As Long
    Dim lbl As DataLabel
    Set ser = ActiveChart.SeriesCollection(9)
    ' note: need to supply one of the text options here
    ser.ApplyDataLabels AutoText:=True, LegendKey:= _
        False, ShowSeriesName:=True, ShowCategoryName:=False, ShowValue:=False, _
        ShowPercentage:=False, ShowBubbleSize:=False
    For n = 1 To ser.Points.Count
        Set lbl = ser.Points(n).DataLabel
        lbl.Characters().Text = "Testing " & n
    Next n
 
Upvote 0
Great. I'll give it a try.

But from your description it looks like you are changing the label in the series. I want to add label to the end or just below the stack based on the length of the stack.

|--------- Total 1
|
|-----------------Total 2
|
|--Total 3
|
_______________________________________________

Something like that.
 
Upvote 0
You can add the datalabels to the last series if you only want them at the end of the stack - or do you already make use of the datalabels in the chart?
 
Upvote 0
I want to add labels to the end of the stack. How do you reference the end? How would the data label get there?
 
Upvote 0
Add them to the last series in the data - then they will be at the end of the stack automatically.
 
Upvote 0
Thank you for hanging in there with me. But, sorry how do you add them to the last series?
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,037
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top