PC Review


Reply
Thread Tools Rate Thread

Chart Legend Items: hide/show

 
 
Richard Ahlvin
Guest
Posts: n/a
 
      19th Aug 2005
How do I hide/show a series on a chart legend (scatter plot.)
I tried a null string (""), but the trace still shows. I also tried #N/A.
But it then shows "#N/A"; the same with function: NA(). What I am trying to
do is to have a control button to show or hide a series from the chart. I
can set all the series values to #N/A which hides it, but I am having
trouble trying to hide the legend for the series. I also tried an "if"
function in the chart->series dialog, but It evidently will only accept a
cell pointer.


 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      20th Aug 2005
You can manually hide a legend entry by selecting it (select the legend
first, then the entry, using two single clicks) and pressing Delete. To
get it back you have to delete the entire legend and then add it back.

You can't automatically adjust the legend based on a formula. You can
filter the data, and any hidden data isn't plotted, either as a series
or as a legend entry. But this isn't automatic either.

You could write a macro which hides and restores the legend based on the
visibility of the series.

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


Richard Ahlvin wrote:

> How do I hide/show a series on a chart legend (scatter plot.)
> I tried a null string (""), but the trace still shows. I also tried #N/A.
> But it then shows "#N/A"; the same with function: NA(). What I am trying to
> do is to have a control button to show or hide a series from the chart. I
> can set all the series values to #N/A which hides it, but I am having
> trouble trying to hide the legend for the series. I also tried an "if"
> function in the chart->series dialog, but It evidently will only accept a
> cell pointer.
>
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      26th Aug 2005


Richard Ahlvin wrote:

>>You could write a macro which hides and restores the legend based on the
>>visibility of the series.

>
> This is an approach I could try; But I have not found the chart object; it
> appears to be a script and not a VBA object. I think I could figgure it out
> in VBA, but I'm not familiar with the scripting (which I thought was
> obsolete!) I have been able to copy a complicated chart and change its
> source data by making the chart a separate sheet, going to the script, then
> using find/replace to change the data sheet name, then move the chart back
> to the desired location.


Richard -

What do you mean by "scripting"? Are you referring to the SERIES formula
in the formula bar, when the series is selected?

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

 
Reply With Quote
 
Richard Ahlvin
Guest
Posts: n/a
 
      29th Aug 2005
I go to: Tools->Macro->Microsoft Script Editor
I see a window with a list of the various sheets on the right.
The main window appears to have something that looks like HTML or maybe XML.
I assume this is a script that is creating the chart. I have successfully
edited that text to change the reference sheet name. (My design is a
worksheet with all the data, text, legends, control references, etc. on it,
and another sheet containing the actual chart and the control graphics.) To
make another chart, I copy the chart to a new sheet, so I now have 2 charts
but referencing the same data. I make up another sheet with the new data
and then go into this script editor and change all of the sheet names from
the first to the new sheet. This has successfully created a second chart
using data from the new sheet. I don't know any other way to do this
quickly. The other method I know is to access each series on the new chart
(which is still referencing the old data sheet) and re-do the label,
x-data, and the y-data for maybe 10 or 12 series; this is very laborious and
time consuming.

If I go to the VBA editor: Tools->Macro->Visual Basic Editor
I see the sheet objects, but none of them have any code, and I don't see the
chart objects...(Perhaps I just don't know where to look.)
I would like to "go-in" and change the code/script/whatever to manipulate
the legend slightly differently than is being done by default.

"Jon Peltier" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> Richard Ahlvin wrote:
>
> >>You could write a macro which hides and restores the legend based on the
> >>visibility of the series.

> >
> > This is an approach I could try; But I have not found the chart object;

it
> > appears to be a script and not a VBA object. I think I could figgure it

out
> > in VBA, but I'm not familiar with the scripting (which I thought was
> > obsolete!) I have been able to copy a complicated chart and change its
> > source data by making the chart a separate sheet, going to the script,

then
> > using find/replace to change the data sheet name, then move the chart

back
> > to the desired location.

>
> Richard -
>
> What do you mean by "scripting"? Are you referring to the SERIES formula
> in the formula bar, when the series is selected?
>
> - Jon



 
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
Hide null column values in chart legend Alex Microsoft Access Forms 1 25th Jun 2008 05:14 PM
Can i hide specific data series in an excel chart yet show the values in the legend??? tony__77 Microsoft Excel Programming 0 27th Sep 2007 07:19 AM
How to hide a dummy series in a chart legend? holg3r Microsoft Excel New Users 2 14th Jul 2005 09:04 AM
Re: Hide part of Excel chart legend? Gord Dibben Windows XP General 0 27th Aug 2004 09:12 PM
Re: Hide part of Excel chart legend? Lanwench [MVP - Exchange] Windows XP General 0 27th Aug 2004 04:05 PM


Features
 

Advertising
 

Newsgroups
 


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