+ Reply to Thread
Results 1 to 5 of 5

Stacked Bar Chart Issue

Hybrid View

  1. #1
    Registered User
    Join Date
    06-13-2017
    Location
    london
    MS-Off Ver
    2016
    Posts
    3

    Post Stacked Bar Chart Issue

    Hi all,

    I'm having an issue with a stacked bar chart.
    I have 22 categories that are allocated for a different amount each month. And only 5 of them are allocated per month.
    I tried to create a stacked bar chart to visualize this per month.

    As you can see from the data below (and in the attachment), all the categories are ordered alphabetically. So in the stacked bar chart, the data gets order in alphabetical order as well.

    What I am trying to do, is order them per size for each month.
    So each month i want the biggest one on top and the smallest allocation at the bottom the chart.

    31/01/2017 28/02/2017 31/03/2017 30/04/2017 31/05/2017
    a 15.00% 18.00% 50.00% 0.00% 0.00%
    b 0.00% 0.00% 0.00% 0.00% 0.00%
    c 0.00% 0.00% 0.00% 0.00% 0.00%
    d 0.00% 0.00% 0.00% 0.00% 0.00%
    e 0.00% 0.00% 0.00% 0.00% 0.00%
    f 0.00% 11.00% 0.00% 0.00% 0.00%
    c 0.00% 6.00% 6.00% 0.00% 18.00%
    h 0.00% 0.00% 0.00% 0.00% 0.00%
    i 6.00% 0.00% 0.00% 0.00% 0.00%
    j 50.00% 50.00% 15.00% 50.00% 0.00%
    k 0.00% 0.00% 0.00% 0.00% 0.00%
    l 0.00% 0.00% 0.00% 0.00% 0.00%
    m 0.00% 15.00% 0.00% 11.00% 6.00%
    n 0.00% 0.00% 0.00% 6.00% 0.00%
    o 0.00% 0.00% 0.00% 0.00% 0.00%
    p 0.00% 0.00% 0.00% 0.00% 0.00%
    q 0.00% 0.00% 0.00% 0.00% 15.00%
    r 0.00% 0.00% 11.00% 18.00% 50.00%
    s 11.00% 0.00% 18.00% 0.00% 0.00%
    t 18.00% 0.00% 0.00% 0.00% 0.00%
    u 0.00% 0.00% 0.00% 15.00% 11.00%
    v 0.00% 0.00% 0.00% 0.00% 0.00%


    Could someone please help me with this?

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,355

    Re: Stacked Bar Chart Issue

    What exactly do you need help with?

    I would expect a process similar to this:

    1) A sort step to sort each column from small to large
    1a) This could be done using the built in Sort command on each column.
    1b) or you can use the SMALL() or LARGE() function to sort the data in a helper column/range. (help file for LARGE() function. SMALL() function is similar https://support.office.com/en-us/art...b-01672ec00a64 ).
    2) Chart should automatically show the data in the first row as the bottom stack and working on up from there.
    2a) If you used SMALL()/LARGE() functions in a helper range, you will need to change the chart's source data to refer to the helper range.

    Is that close to what you want?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    06-13-2017
    Location
    london
    MS-Off Ver
    2016
    Posts
    3

    Re: Stacked Bar Chart Issue

    Thank you for your response, but that doesn't seem to be working.

    If I sort the columns, the categories seem to change. Meaning the same value is not linked to the same category any more.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,355

    Re: Stacked Bar Chart Issue

    That is correct, but that is how stacked column charts work. Here are some ideas for "re-establishing the connection" between each data point and its original category.

    1) Format all data series the same, and use data labels to indicate which category each stacked column belongs to. This is probably the easiest to implement, but it could be the most difficult to read. With as many data points as you potentially have in the chart, the chart could get very busy with all of that text.

    2) Format each data point individually so that all points for each category are formatted the same.
    2a) If this is a one time thing and you are unfamiliar with VBA programming, it will be easier -- even if it is tedious -- to manually format each data point the way you would like.
    2b) If you will need to do this frequently, you will almost certainly want a VBA procedure that will loop through each data point in each data series and format it accordingly. This will probably be the most "expensive" approach up front (especially if you will be learning VBA from the bottom up along the way), but it will give you a nice procedure that will fix this up for you whenever you need to do this task.

    However you decide to approach this, you will need to do something in the spreadsheet to readily identify what category goes with each data point. Exactly how to do this will depend on the approach you chose to sort the data points.

  5. #5
    Registered User
    Join Date
    06-13-2017
    Location
    london
    MS-Off Ver
    2016
    Posts
    3

    Re: Stacked Bar Chart Issue

    Cool thank you!

+ 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. Stacked Bar chart date issue
    By petermikula in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-21-2017, 04:50 PM
  2. [SOLVED] Waterfall + stacked bar chart Excel issue
    By jw01 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 06-22-2015, 03:38 PM
  3. Stacked Area Chart Taper on/off issue
    By tonykslee in forum Excel Charting & Pivots
    Replies: 15
    Last Post: 04-30-2014, 10:45 AM
  4. Diverging Stacked Bar Chart issue
    By Lis7 in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 06-23-2013, 07:00 PM
  5. Replies: 1
    Last Post: 05-30-2013, 10:03 AM
  6. How can I combine a stacked bar chart with stacked colum chart?
    By Sin in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 12-19-2005, 11:55 PM
  7. [SOLVED] To create a stacked column chart and group the stacked bars togeth
    By Jacqueline in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-18-2005, 10:06 AM

Tags for this Thread

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