PDA

View Full Version : Controlling Pie Chart Legend Colors



talytech
02-23-2009, 02:22 PM
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/forums/showthread.php?t=166503

talytech
02-24-2009, 12:20 PM
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.

adilsonpuro
02-26-2009, 10:37 AM
taly, give me more information like:
- where is the chart (access or excel)

talytech
02-26-2009, 10:42 AM
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.

adilsonpuro
02-26-2009, 07:25 PM
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.

orange
03-03-2009, 07:40 PM
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/working-with-chart-object-in-vba.shtml

Hope it is useful.

talytech
03-04-2009, 09:19 AM
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.