Like user1813558 in his question "Change the pie chart colors" I would like to choose the colors that Excel uses for a pie chart (indeed for any chart) as I need them to be consistent with other data visualizations we have carefully produced so that a color-blind team mate can still join in data trawl sessions. But rather than write code I would like to do it in the Excel sheet. Is there any way I can put the color data down in the Excel worksheet, for example as a column of RGB hex strings like 7DFF7D, and point the chart at that column for its color choice?
Excel Charts – How to Provide RGB Hex Strings for Pie Chart Colors
chartscolorsmicrosoft excelmicrosoft-excel-2013
Related Solutions
Personally Peltier's Chart Blog is my favorite Excel Charting source. So take a look at some of the samples he discussed there. To know more here is the MVP
I do not think it's wonderful to copy his codes here. So try the tutorials stated in above materials out and comment if you have further questions. And here is some facts I thought would be helpful in your Charting Journey to be smooth and fun.
To be very specific on RGB Colour
formatting of your pie chart
slices, here is the code line:
E.g.
ActiveChart.SeriesCollection(1).Points(1).Interior.Color = RGB(0, 176, 80)
You may find RGB
colour numbers from MS Paint
application in Windows :)
Else here is an article that shows some colours and corresponding RGB
numbers.
As colour spectrum is infinite, it should be good enough to colour your extra multi sliced pie chart
, you may think.. HOWEVER don't forget that Excel default colour Palette has 56 colour indices. Like Excel 2003. So sometimes there are issues when using your Chart file in a different version of Excel - where you find some colours are missing and just being replaced by unappealing old looking colours ;)
E.g. A Chart created in Excel 2007 and above has rich graphical, colour experience to the user. However Excel 2003 doesn't provide so, but manageable (and extremely great in performance though.) In Excel 2007 and later, workbooks can support millions of colors, but there is still an underlying workbook palette that has 56 colors.
So when you face such issues or be read to deal with it, plesae check on this article:
The first six series will be colored with the first six accent colors of the current theme. The next six series will be colored with a slightly lighter shade of these accent colors. The next six series will be colored with another slightly lighter shade of these accent colors. If you have more than 18 series in a chart, you should consider a different approach for your data visualisation, because it will be pretty hard to read and understand.
Using just the ribbon and the user interface, you can only manually format the chart elements. Using VBA you can set a chart element's color to a value that is represented as a hex value in a cell, but you would need to learn how to write VBA code for charts. It has a learning curve.
The answers are not the same for other versions of Excel. Office 2007 introduced themes and a completely new way of handling colors. Before that, there was a limited palette of 56 or so colors only. Excel 2013 uses the same principles (i.e. theme colors), but a different approach to apply them to charts (6 accents, then 6 darker accents, then 6 lighter accents, ...)
Best Answer
What you would like to do is not possible without code.
The following VBA function can be used to set colors based on cell values for a pie chart in the active worksheet. The color values can be in an N rows x 3 columns range of decimal RGB values or an N rows x 1 column range of 6 digit hex values (where the hex number is a set of three 2-digit hex values in RGB order).
The function requires two arguments: a reference to the range of color values (A1:A5, for example) and the name of the pie chart. The chart name can either be a default name (such as "Chart 2") or a name given to the chart.
If the number of columns in the input range does not equal 3 or 1, or the number of rows does not equal the number of data points in the pie chart, the function returns #N/A! error.
A recolored chart will retain the new colors after the function is deleted from the sheet.
The function can be installed by copying it into a new module inserted via the Developer / Visual Basic menu accessed from the Excel ribbon.