+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    03-08-2007
    Posts
    4

    Column Chart - color based on x value

    Hello, I have a table similar to this (attachment - 2 columns and 12 rows).

    Here I want to plot A on x axis and B on y axis using column chart. The columns color should be based on the x value (4 unique colors for 4 unique values - P/Q/R/S). How can I do this? I have hundreds of such rows.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Column Chart - color based on x value

    Hi,

    it's all about the data layout.

    Like this, maybe? See attached

    hth
    Attached Files Attached Files
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  3. #3
    Registered User
    Join Date
    03-08-2007
    Posts
    4

    Re: Column Chart - color based on x value

    Thanks for help. I want the graph look like this, but I want to -

    1. Do it without making another table specifying values of P, Q, R and S
    2. Would like to have P, Q, R and S written on x axis

    Can you help?

    Thanks.

  4. #4
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Column Chart - color based on x value

    Well, then the only way I can see is to create a simple column chart and manually select the color for each data point.

    Every other solution will involve the creation of another table to hold the data, unless you find a VBA wiz to write a macro for you.

    Data layout is an essential part of chart creation. I've solved your second requirement in the attached file, where you can see that each data label now has its own color. It's like conditional formatting for charts, but you need a helper table to achieve it. (the helper table could be on a different sheet, of course!)

    See what you can do with that.

    cheers
    Attached Files Attached Files
    Last edited by teylyn; 11-19-2009 at 07:08 AM. Reason: typo. nitpick
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  5. #5
    Registered User
    Join Date
    03-08-2007
    Posts
    4

    Re: Column Chart - color based on x value

    Many thanks Teylyn.

Thread Information

Users Browsing this Thread

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

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.2.0