ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Data Label size (https://www.excelbanter.com/excel-worksheet-functions/188413-data-label-size.html)

Phil Stanton[_2_]

Data Label size
 
I am trying to position datalabels on a scatter chart using Bob Bovey's XY
labeller. This puts a label on a chart for each point. Many of the labels
are sloping upwards and consequently I need the bottom left of the label
next to the point concerned. The label position is defined by the Top and
Left and I want to position it by the Bottom Left. Consequently I need to
know the height of the label.
Any ideas how

Thanks

Phil



Andy Pope

Data Label size
 
Hi,

You can not get the Width or Height directly via the object model.
As a work around what you can do is, via code, attempt to move the data
label outside of the chartareas boundaries. As this is not possible the
data labels gets positioned as near to the edge as possible. You can
then use the new left and top position to do some simple maths to work
out the width and height.

Cheers
Andy

Phil Stanton wrote:
I am trying to position datalabels on a scatter chart using Bob Bovey's XY
labeller. This puts a label on a chart for each point. Many of the labels
are sloping upwards and consequently I need the bottom left of the label
next to the point concerned. The label position is defined by the Top and
Left and I want to position it by the Bottom Left. Consequently I need to
know the height of the label.
Any ideas how

Thanks

Phil



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Phil Stanton[_2_]

Data Label size
 
Thanks Andy

That works fine. I now have the bottom left position.

Now I need to get the position (in points???) of the point to which it
refers. Can you help on that one

Thanks again

Phil


"Andy Pope" wrote in message
...
Hi,

You can not get the Width or Height directly via the object model.
As a work around what you can do is, via code, attempt to move the data
label outside of the chartareas boundaries. As this is not possible the
data labels gets positioned as near to the edge as possible. You can then
use the new left and top position to do some simple maths to work out the
width and height.

Cheers
Andy

Phil Stanton wrote:
I am trying to position datalabels on a scatter chart using Bob Bovey's
XY labeller. This puts a label on a chart for each point. Many of the
labels are sloping upwards and consequently I need the bottom left of the
label next to the point concerned. The label position is defined by the
Top and Left and I want to position it by the Bottom Left. Consequently I
need to know the height of the label.
Any ideas how

Thanks

Phil


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info




Andy Pope

Data Label size
 
Now you have the dimensions of the data label if you center the data label
you can again use a little math to calculate the points position.
So the new Left and Top values plus half the width and height.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Phil Stanton" wrote in message
et...
Thanks Andy

That works fine. I now have the bottom left position.

Now I need to get the position (in points???) of the point to which it
refers. Can you help on that one

Thanks again

Phil


"Andy Pope" wrote in message
...
Hi,

You can not get the Width or Height directly via the object model.
As a work around what you can do is, via code, attempt to move the data
label outside of the chartareas boundaries. As this is not possible the
data labels gets positioned as near to the edge as possible. You can then
use the new left and top position to do some simple maths to work out the
width and height.

Cheers
Andy

Phil Stanton wrote:
I am trying to position datalabels on a scatter chart using Bob Bovey's
XY labeller. This puts a label on a chart for each point. Many of the
labels are sloping upwards and consequently I need the bottom left of
the label next to the point concerned. The label position is defined by
the Top and Left and I want to position it by the Bottom Left.
Consequently I need to know the height of the label.
Any ideas how

Thanks

Phil


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info





Phil Stanton[_2_]

Data Label size
 
Brilliant

Works a treat

Thanks

Phil

"Andy Pope" wrote in message
...
Now you have the dimensions of the data label if you center the data label
you can again use a little math to calculate the points position.
So the new Left and Top values plus half the width and height.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Phil Stanton" wrote in message
et...
Thanks Andy

That works fine. I now have the bottom left position.

Now I need to get the position (in points???) of the point to which it
refers. Can you help on that one

Thanks again

Phil


"Andy Pope" wrote in message
...
Hi,

You can not get the Width or Height directly via the object model.
As a work around what you can do is, via code, attempt to move the data
label outside of the chartareas boundaries. As this is not possible the
data labels gets positioned as near to the edge as possible. You can
then use the new left and top position to do some simple maths to work
out the width and height.

Cheers
Andy

Phil Stanton wrote:
I am trying to position datalabels on a scatter chart using Bob Bovey's
XY labeller. This puts a label on a chart for each point. Many of the
labels are sloping upwards and consequently I need the bottom left of
the label next to the point concerned. The label position is defined by
the Top and Left and I want to position it by the Bottom Left.
Consequently I need to know the height of the label.
Any ideas how

Thanks

Phil

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info








All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com