Consulting

Results 1 to 7 of 7

Thread: Controlling Pie Chart Legend Colors

  1. #1

    Controlling Pie Chart Legend Colors

    Controlling Pie Chart Legend Colors
    I have a pie chart with 5 categories. The legend is color coded. But if one of the categories is 0 then the corresponding color for that category is moved to the next category. For example.

    1 = green
    2 = blue
    3 = yellow
    4 = orange
    5 = red

    If category 1 has a total of 0 then the legend colors are displayed like this:

    2 = green
    3 = blue
    4 = yellow
    5 = orange

    How can I keep colors consistent for the legend? Is this possible?

    I want the categories to stay the same color. If there is a total of 0 for a category then that color isn't displayed.

    By the way, I posted this question in another forum and I didn't receive any answers so I'm posting here hopefully to get some answers.

    http://www.access-programmers.co.uk/...d.php?t=166503

  2. #2
    Hello ... Is anybody out there? or Is my question way too far fetched. Just let me know if it's possible. I've been researching and I found that colors for the "LegendObject" in Excel can be programmed. Can I incorporate such code in Access? Somebody please help me.

  3. #3
    VBAX Newbie adilsonpuro's Avatar
    Joined
    Feb 2009
    Location
    Curitiba - PR - Brazil
    Posts
    3
    Location
    taly, give me more information like:
    - where is the chart (access or excel)

  4. #4
    The chart is in MS Access. The source for the chart is a query that returns totals. My chart comes out find. Its a small issue to me but the client wants consistency with the category colors. For instance, he wants "Completed" to always be green and "Incomplete" to be blue and "Pending" to be red. But if "Completed" has a value of 0, then it doesn't show in the legend and now "Incomplete" is green and "Pending" is blue.

  5. #5
    VBAX Newbie adilsonpuro's Avatar
    Joined
    Feb 2009
    Location
    Curitiba - PR - Brazil
    Posts
    3
    Location
    Taly, this is an assumption. I did some tests and I saw that colors are related to series order.
    This means that the series order controls how colors are displayed and you should always use the same order to show information.
    Maybe it will be necessary build a new query, to show all information equal or bigger than zero.

  6. #6
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    257
    Location
    Quote Originally Posted by adilsonpuro
    Taly, this is an assumption. I did some tests and I saw that colors are related to series order.
    This means that the series order controls how colors are displayed and you should always use the same order to show information.
    Maybe it will be necessary build a new query, to show all information equal or bigger than zero.
    Here's a link with Access vba and chart sample.

    http://www.msaccesstips.com/2008/06/...t-in-vba.shtml

    Hope it is useful.

  7. #7
    thanks Orange .. for some reason, that link only gave me information about creating a chart in Access. The link to "Working with Chart Object in VBA" didn't return anything. But thanks anyway. I'll keep searching. I feel like I'm getting closer.

Posting Permissions

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