Text above bars in chart

A

Andy Pope

Hi,

The first problem you are going to have is that data labels will not
display that amount of text in a single line. Instead you will need to
add text boxes. So, unless you do it all manually, you will have to use
vba. I have some code for replacing Axis label which you maybe able to
adapt.
http://www.andypope.info/vba/Axislabel_textboxes.htm

If you add a row between each of your statements and stagger the rows
text and values it should work, with a little alteration to the position
of the textbox.

I would suggest using a 2d rather than 3d chart and trying to short the
statements.

Cheers
Andy
 
M

Magnus

Thank you Andy,

Well, using vba feels a little bit overkill for the users that wants this
behavior.
Is there any way to get the text above each bar even if it will be wrapped
or truncated?

Regards Magnus
 
A

Andy Pope

Hi,

Yes, as I said stagger your data and labels along with a dummy series.
Assuming your test data was in the range A1:E11 what you need to do is
insert a row between each data row, expanding it to A1:E20.
No insert a cell above the axis labels so they appear in A3:A21.
Add a set of data to column F with the label Dummy. The value being 100%
and populate the cells on the same rows as the axis labels.
In order to stop Excel incorrectly guessing your data add a space to the
currently empty cell A2.
Now select the range A1:F21 and create stacked bar chart.
Apply data labels to the Dummy series display category name.
Format the series to have no fill or border.
Delete the category axis.

You should now have double spaced stack bars with text in the middle,
but as I said that amount of text will not look pretty in a data label.

Cheers
Andy
Thank you Andy,

Well, using vba feels a little bit overkill for the users that wants this
behavior.
Is there any way to get the text above each bar even if it will be wrapped
or truncated?

Regards Magnus
 

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