PC Review


Reply
Thread Tools Rate Thread

chart labels

 
 
=?Utf-8?B?Zm9pbGZlbmNpbmdhbmR5?=
Guest
Posts: n/a
 
      25th Jan 2007
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 With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      25th Jan 2007
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" <(E-Mail Removed)> wrote in
message news:074D8F15-18EC-4A6B-87BA-(E-Mail Removed)...
>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 With Quote
 
=?Utf-8?B?Zm9pbGZlbmNpbmdhbmR5?=
Guest
Posts: n/a
 
      25th Jan 2007
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" <(E-Mail Removed)> wrote in
> message news:074D8F15-18EC-4A6B-87BA-(E-Mail Removed)...
> >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 With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      25th Jan 2007
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" <(E-Mail Removed)> wrote in
message news:7F7DA474-92E6-461B-BD9D-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in
>> message news:074D8F15-18EC-4A6B-87BA-(E-Mail Removed)...
>> >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 With Quote
 
=?Utf-8?B?Zm9pbGZlbmNpbmdhbmR5?=
Guest
Posts: n/a
 
      26th Jan 2007
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" <(E-Mail Removed)> wrote in
> message news:7F7DA474-92E6-461B-BD9D-(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in
> >> message news:074D8F15-18EC-4A6B-87BA-(E-Mail Removed)...
> >> >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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to change position of chart labels on line chart Shane Henderson Microsoft Excel Charting 1 27th May 2011 09:31 AM
Chart labels disappear - How do I refresh the chart? =?Utf-8?B?amNsb3lkamNsb3lk?= Microsoft Excel Charting 0 30th Mar 2006 07:49 PM
XY chart with labels =?Utf-8?B?RFNLXzc=?= Microsoft Excel Charting 1 24th Jun 2005 08:50 PM
Chart labels at 90 degrees in chart do not correctly align =?Utf-8?B?UGF0cmljaWE=?= Microsoft Powerpoint 2 2nd Feb 2005 08:38 PM
Chart Labels Erin Microsoft Excel Programming 1 20th Apr 2004 01:16 PM


Features
 

Advertising
 

Newsgroups
 


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