+ Reply to Thread
Results 1 to 13 of 13

Chart: only show legend elements with values

  1. #1
    Registered User
    Join Date
    11-21-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    10

    Chart: only show legend elements with values

    Hi guys

    I have 10 graphs with more than 20 legend entries. However, each graph only needs 3-4 elements out of the 20 legend entries in the graph.
    Is there any way to force Excel to only show those legend entries that have a value? (without deleting them manually)

    Thanks in advance!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart: only show legend elements with values

    If Plot visible cells only is set you can hide the row/column containing the data.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-21-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Chart: only show legend elements with values

    Quote Originally Posted by Andy Pope View Post
    If Plot visible cells only is set you can hide the row/column containing the data.
    Thanks for your answer.
    But this won't solve my problem because for a certain row, there might be no data, but the one beneath it does have data. So I can't just hide those columns. (I'm making a different graph per row out of the same table)
    Last edited by Brython; 11-22-2013 at 05:29 AM.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart: only show legend elements with values

    Assuming the setting is on are you saying it has no affect when you hide the cells?

    Post example worrkbook

  5. #5
    Registered User
    Join Date
    11-21-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Chart: only show legend elements with values

    It does have effect, however, not the effect that is desired. As I am currently working with confidential documents I can't post a document. I might make a draft one with exemplary figures in a minute if I find the time.

    Basically what I have is a table of 7 rows and 30 columns and one additional header row. Basically I am making a graph for each row. So each row uses the header row and the data that is in each of the 30 columns on that specific row. The graph of each row only has 3-5 columns with data on average. So the legend has 29 values (30 columns minus the first columns). But each graph only has 3-5 values. I'm making a stacked bar chart with these 3-5 values and I only want those colors to be mentioned in my Legend. However, this does not work with the function you proposed. But I really appreciate your input already.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart: only show legend elements with values

    If you have a single data table for all charts and those charts only require some of the data then hiding information will not work as once hidden it will affect all charts.

    either use separate data tables for each chart or vba code to remove unwanted legend entries

  7. #7
    Registered User
    Join Date
    11-21-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Chart: only show legend elements with values

    Ok thanks. Too bad Excel does not have this function, this is a huge bummer regarding my limited time.
    Thanks a lot!

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart: only show legend elements with values

    xl2013 has the ability, albeit manually, to filter out series

  9. #9
    Registered User
    Join Date
    11-21-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    10

    Re: Chart: only show legend elements with values

    Quote Originally Posted by Andy Pope View Post
    xl2013 has the ability, albeit manually, to filter out series
    And how would this work then? This might be a savior

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Chart: only show legend elements with values

    If you select the chart object you should see 3 squares on the right, Add elements, Format and Filter.

    Click the Filter and see what effect that has.

  11. #11
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Chart: only show legend elements with values

    It may also be done in code if required:
    Please Login or Register  to view this content.
    for example will hide the second series.

  12. #12
    Registered User
    Join Date
    10-02-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Chart: only show legend elements with values

    If I'm using excel 2010, where do I locate the option button to "If Plot visible cells only"?

  13. #13
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Chart: only show legend elements with values

    You may right-click the chart, then 'Select Data...' then click the 'Hidden and empty cells' button.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compressing legend of pivot chart to only show relevant names
    By Jasper333 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2012, 09:26 AM
  2. [CHART] adding values to legend
    By TomBP in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-15-2010, 05:57 AM
  3. Creating a table of values in a pie chart legend
    By simmo86 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 06-23-2009, 11:31 AM
  4. Legend Needs to show numbers...HELP
    By Roberta in forum Excel General
    Replies: 3
    Last Post: 09-12-2005, 10:05 AM
  5. Chart Legend Items: hide/show
    By Richard Ahlvin in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 09-05-2005, 11:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1