Home |
Search |
Today's Posts |
#1
|
|||
|
|||
determine colouring of variables of a pie chart
I am using pie charts right now to show the size of marketshare of some
companies within a few countries. It would be usefull if I could give the different companies in every pie chart their " own" colour. Do you have some suggestions about the best way to do this? Kind regards, Menno |
#2
|
|||
|
|||
This macro will recolor the points in a series based on the category
labels. Replace "AAAA" etc. by the names of the companies, and the numbers by whatever numbers produce the colors you need. You'll need to experiment a little. Sub ColorColumns() Dim iPoint As Long, nPoint As Long With ActiveSheet.ChartObjects(2).Chart.SeriesCollection (1) For iPoint = 1 To .Points.Count Select Case WorksheetFunction.Index(.XValues, iPoint) Case "AAAA" .Points(iPoint).Interior.ColorIndex = 6 ' Yellow Case "BBBB" .Points(iPoint).Interior.ColorIndex = 5 ' Blue Case "CCCC" .Points(iPoint).Interior.ColorIndex = 3 ' Red Case "DDDD" .Points(iPoint).Interior.ColorIndex = 13 ' Purple Case "EEEE" .Points(iPoint).Interior.ColorIndex = 46 ' Orange Case "FFFF" .Points(iPoint).Interior.ColorIndex = 4 ' Green Case "GGGG" .Points(iPoint).Interior.ColorIndex = 8 ' Cyan End Select Next End With End Sub - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Menjo wrote: I am using pie charts right now to show the size of marketshare of some companies within a few countries. It would be usefull if I could give the different companies in every pie chart their " own" colour. Do you have some suggestions about the best way to do this? Kind regards, Menno |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Activating a Chart object | Charts and Charting in Excel | |||
Urgent Chart Assistance | Charts and Charting in Excel | |||
Urgent Chart Questions | Excel Discussion (Misc queries) | |||
Urgent Chart Assistance Requested | Excel Discussion (Misc queries) | |||
Use variables for a chart | Charts and Charting in Excel |