PC Review


Reply
Thread Tools Rate Thread

determine colouring of variables of a pie chart

 
 
=?Utf-8?B?TWVuam8=?=
Guest
Posts: n/a
 
      8th Aug 2005
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 With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      8th Aug 2005
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Colouring area under curve in a scatter chart? Ed Ferrero Microsoft Excel Charting 6 17th Nov 2007 03:09 PM
Colouring error bars in a chart Graham Whitehead Microsoft Excel Programming 1 4th Aug 2006 02:59 PM
colouring in bars on a chart to correspond to quartiles Graham Whitehead Microsoft Excel Programming 1 28th Jul 2006 03:27 AM
Pie Chart Colouring - for top surface of slices only =?Utf-8?B?U3V6IENhbXBiZWxs?= Microsoft Excel Charting 1 19th Jul 2005 03:08 AM
Colouring Chart backgrounds Amanda Microsoft Excel Charting 5 16th Jul 2003 04:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:45 PM.