Dynamic data label placement for graphs

  • Thread starter Thread starter Hafeez
  • Start date Start date
H

Hafeez

I've read the article KB179199 on how to create custom
data labels for charts and it's good, however doesn't meet
all my requirements.
Is there a way to have the data labels automatically move
to a desired location relative to the graph?
For instance, I'm using 50 bar graphs per work book and
would like each data label to be just above their
respective bar.

TIA
Hafeez
 
I looked up article 179199 and got this:

BUG: Grid Based on .QPR File Appears Blank in Visual FoxPro 5.0

which probably isn't the one you meant. By above the bar, are they
horizontal bars and you want them to be between their bar and the next
higher one? Or do you mean they're columns (vertical bars) and you want
them above the top of the column?

If it's a column chart, one of the positions you can specify for data
labels is Above. Double click on the labels, click on the Alignment tab,
and choose Above from the dropdown.

If it's a bar chart, and you want to move the labels off the axis of the
bars, you'll need to use VBA. Start with the labels in the Center
position, then determine how far you want to move the bars; a good guess
is PlotArea.InsideHeight/SeriesCollection(1).Points.Count/2. Record a
macro while you drag one label around manually to get the syntax right.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Hi Jon
My appologies, its 279199.
The graphs are vertical bar graphs.
What I would like to do is to change the value of each
label in each graph.
What I found out just now was that the number I wish to
display as the label appears 1 cell to the right of the
cell that contains the value (soure data) for that
particular bar.
Is there a way - through code I suppose - I can
automatically cycle through all of the graphs in a
workbook and make that change?

Any direction would be muchly appreciated
TIA
Hafeez
 
Back
Top