+ Reply to Thread
Results 1 to 9 of 9

Automatic coloring pivot chart bars

  1. #1
    Registered User
    Join Date
    08-26-2013
    Location
    Egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    Automatic coloring pivot chart bars

    Hi
    I have a sheet in which records for different players in different teams are added

    4 teams
    And multiple players.. around 40 players total

    When i make the pivot chart to show the records for all players, im trying to give each player bar a color depending on player's team name
    Is there a way to do that automatically?

    For example
    Blue teamp player: blue bar
    Red team player: red bar
    Orange team player: orange bar
    Etc

    The thing is that the data sorting is changed all the time from top to bottom record
    And if i color bars manually, the color remain on bars regardless of player name on that bar

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Automatic coloring pivot chart bars

    Hi I-fathy,

    You can apply Conditional Formatting to the Column &/or Rows that the Pivot sits on & have the rules apply changes based on what you've asked for.

    I've attached a quick example.

    If you change the values in Cells A8-A10 to either RED, ORANGE OR BLUE, the Cell colour will change.

    Cheers
    Attached Files Attached Files
    Remember you are unique, like everyone else

  3. #3
    Registered User
    Join Date
    08-26-2013
    Location
    Egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Automatic coloring pivot chart bars

    Hi noboffinme,
    i don't know if it is just me, as i cant get if what you said should be what i want

    in your example i didn't find any charts, just pivot table, however im asking about pivot charts.

    i attached an example of the chart im talking about.

    in my chart, i want to color the bar of each player on basis of the team name next to each player name, from the source table
    Attached Files Attached Files

  4. #4
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Automatic coloring pivot chart bars

    Hi I-fathy,

    Sorry, my mistake, I would suggest for a chart that a macro be used to change the Chart bar colour relative to the Table for your names.

    Are you familiar with writing VBA?

  5. #5
    Registered User
    Join Date
    08-26-2013
    Location
    Egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Automatic coloring pivot chart bars

    Im not sure how to do it, could you help me?

  6. #6
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Automatic coloring pivot chart bars

    Hi I-fathy,

    I got some of the way there but am stuck with one part & I hope that someone else in the forum can help.

    I am trying to get the macro to match the colours in Column 'B' against the name is the same colour applied to the person on the chart.

    The problem is the line where 'BLUE appears as the code doesn't like my 'Cells.Range("B2").Interior.Color' code.

    I think it wants the same but with an 'mso' value.

    Can anyone assist I-fathy with this?


    Please Login or Register  to view this content.

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

    Re: Automatic coloring pivot chart bars

    If you change the layout of your pivot table you can do it automatically.

    Set the overlap of columns to 100.
    Format each of the team colours as required.

    Now use the column field to filter the teams.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  8. #8
    Registered User
    Join Date
    08-26-2013
    Location
    Egypt
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Automatic coloring pivot chart bars

    @noboffinme thanks a lot for your effort to help What Andy suggested seems to do the job

    @Andy many thanks it seems to work by just putting the team columns in "Legend fields", i will test it on my main workbook and tell you if something isnt right

    but what do you mean by setting overlap of the columns to 100?

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

    Re: Automatic coloring pivot chart bars

    select one of the columns in the new chart and display the format dialog.
    On the Series Option tab is the Overlap setting. set it to 100. This make all the columns in a category appear infront of each other rather than side by side.

+ 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. Replies: 1
    Last Post: 07-22-2015, 07:16 AM
  2. Replies: 2
    Last Post: 05-26-2014, 05:11 AM
  3. coloring bars in a stacked bar chart (Yamazumi chart) on basis of text
    By Rob201 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2014, 04:56 AM
  4. Multi colored bars in Pivot Chart?
    By jsabo in forum Excel General
    Replies: 1
    Last Post: 01-23-2014, 12:09 PM
  5. [SOLVED] Possible to conditional format fill color of pivot chart bars?
    By DaveF in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 10-31-2013, 09:12 AM
  6. Waterfall Chart with automatic coloring and text coloring
    By amartino44 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-19-2013, 05:54 PM
  7. [SOLVED] assign permanent colors to bars/values in a pivot chart
    By Rose73 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-01-2006, 01:00 PM

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