Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default chart labels

I know there are some great chart labelling tools out there, but I decided to
go it alone.... I can label a chart using a routine which reads a stats
report, and labels a,b or c or any combination of, depending on which groups
are different from control. Works great. But, I'm using xlLabelPositionAbove,
which sometimes plonks the labels on the error bars. I could use the
datalabel.top, but this is a bit rigid. How can I make the label position a
bit more dynamic so that it relates to the position of the point, and
possibly the size of the error bar. How do I ask excel where a point is on
the graph? thanks muchly :-)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default chart labels

Add an XY series to the chart, with X and Y selected so the plotted point is
at the top of the error bars (or another convenient location). Make the
series hidden (no marker and no lines) and assign custom labels to this
series.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"foilfencingandy" wrote in
message ...
I know there are some great chart labelling tools out there, but I decided
to
go it alone.... I can label a chart using a routine which reads a stats
report, and labels a,b or c or any combination of, depending on which
groups
are different from control. Works great. But, I'm using
xlLabelPositionAbove,
which sometimes plonks the labels on the error bars. I could use the
datalabel.top, but this is a bit rigid. How can I make the label position
a
bit more dynamic so that it relates to the position of the point, and
possibly the size of the error bar. How do I ask excel where a point is on
the graph? thanks muchly :-)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default chart labels

Thanks Jon, good plan. I will use it as a simple option if I have to, though
I would still like to be able to interact with the chart data from within VBA
- is this possible? Can you query the position of a plotted point?
Main problem is that the graphs are generated within a template which I'd
rather not have to mess with too much, adding extra data series etc.

thanks for your time,
Andy

"Jon Peltier" wrote:

Add an XY series to the chart, with X and Y selected so the plotted point is
at the top of the error bars (or another convenient location). Make the
series hidden (no marker and no lines) and assign custom labels to this
series.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"foilfencingandy" wrote in
message ...
I know there are some great chart labelling tools out there, but I decided
to
go it alone.... I can label a chart using a routine which reads a stats
report, and labels a,b or c or any combination of, depending on which
groups
are different from control. Works great. But, I'm using
xlLabelPositionAbove,
which sometimes plonks the labels on the error bars. I could use the
datalabel.top, but this is a bit rigid. How can I make the label position
a
bit more dynamic so that it relates to the position of the point, and
possibly the size of the error bar. How do I ask excel where a point is on
the graph? thanks muchly :-)




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default chart labels

Andy -

You can of course interact with the chart elements via VBA. The problem with
data labels is that changing away from one of the standard positions to a
prescribed .Top and .Left break the positional link between a label and its
data point. If the data or axes change, the points all move but the label no
longer keeps up. Using a spare series ensures that the label stays with the
point you so cleverly determined the appropriate X and Y for.

In my experience, using spare series in templates is more robust and easier
for the developer than using VBA to make every little change. You can
determine positions of chart elements based on X and Y values if you're
comfortable with algebra, but if you use the helper series approach, you can
skip the hard math.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"foilfencingandy" wrote in
message ...
Thanks Jon, good plan. I will use it as a simple option if I have to,
though
I would still like to be able to interact with the chart data from within
VBA
- is this possible? Can you query the position of a plotted point?
Main problem is that the graphs are generated within a template which I'd
rather not have to mess with too much, adding extra data series etc.

thanks for your time,
Andy

"Jon Peltier" wrote:

Add an XY series to the chart, with X and Y selected so the plotted point
is
at the top of the error bars (or another convenient location). Make the
series hidden (no marker and no lines) and assign custom labels to this
series.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"foilfencingandy" wrote in
message ...
I know there are some great chart labelling tools out there, but I
decided
to
go it alone.... I can label a chart using a routine which reads a stats
report, and labels a,b or c or any combination of, depending on which
groups
are different from control. Works great. But, I'm using
xlLabelPositionAbove,
which sometimes plonks the labels on the error bars. I could use the
datalabel.top, but this is a bit rigid. How can I make the label
position
a
bit more dynamic so that it relates to the position of the point, and
possibly the size of the error bar. How do I ask excel where a point is
on
the graph? thanks muchly :-)






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default chart labels

I've just had a play, and the wisdom of your logic now becomes clear. I shall
wander off and amend my templates accordingly.......

thanks again,
Andy

"Jon Peltier" wrote:

Andy -

You can of course interact with the chart elements via VBA. The problem with
data labels is that changing away from one of the standard positions to a
prescribed .Top and .Left break the positional link between a label and its
data point. If the data or axes change, the points all move but the label no
longer keeps up. Using a spare series ensures that the label stays with the
point you so cleverly determined the appropriate X and Y for.

In my experience, using spare series in templates is more robust and easier
for the developer than using VBA to make every little change. You can
determine positions of chart elements based on X and Y values if you're
comfortable with algebra, but if you use the helper series approach, you can
skip the hard math.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"foilfencingandy" wrote in
message ...
Thanks Jon, good plan. I will use it as a simple option if I have to,
though
I would still like to be able to interact with the chart data from within
VBA
- is this possible? Can you query the position of a plotted point?
Main problem is that the graphs are generated within a template which I'd
rather not have to mess with too much, adding extra data series etc.

thanks for your time,
Andy

"Jon Peltier" wrote:

Add an XY series to the chart, with X and Y selected so the plotted point
is
at the top of the error bars (or another convenient location). Make the
series hidden (no marker and no lines) and assign custom labels to this
series.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"foilfencingandy" wrote in
message ...
I know there are some great chart labelling tools out there, but I
decided
to
go it alone.... I can label a chart using a routine which reads a stats
report, and labels a,b or c or any combination of, depending on which
groups
are different from control. Works great. But, I'm using
xlLabelPositionAbove,
which sometimes plonks the labels on the error bars. I could use the
datalabel.top, but this is a bit rigid. How can I make the label
position
a
bit more dynamic so that it relates to the position of the point, and
possibly the size of the error bar. How do I ask excel where a point is
on
the graph? thanks muchly :-)






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to change position of chart labels on line chart Shane Henderson[_2_] Charts and Charting in Excel 1 May 27th 11 09:31 AM
Pie Chart and Zero Value Labels Hardip Charts and Charting in Excel 1 August 7th 09 09:21 AM
Labels in a chart Charles Eaves Charts and Charting in Excel 3 November 4th 08 02:18 PM
Chart labels disappear - How do I refresh the chart? jcloydjcloyd Charts and Charting in Excel 0 March 30th 06 07:49 PM
Labels on a chart Kevin Charts and Charting in Excel 1 February 10th 05 09:16 AM


All times are GMT +1. The time now is 09:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"