PDA

View Full Version : [SOLVED] How to change the color of the columns in the chart?



krishnak
09-15-2010, 04:33 PM
Hi All,

In the attached Excel workbook, I have three columns - PlCode, AvgReliability, Profile. I have drawn the column chart using the first two column values - PlCode and AvgReliability. That is quite simple.

Now keeping this chart intact, I want to apply different colors to the bars depending to which Profile each bar belongs (third column of the worksheet). If the Profile is A, I want the corresponding chart columns to show in Red, Profile B in Blue, Profile C in Yellow and Profile D in Green.

For example, the first bar (PL 103) should show in Red color (Profile A), the second bar (PL 046) should show in Blue color and so on.

How can I do it either manually or by VBA?

Thanks in advance for any suggestions.

krishnak
09-15-2010, 06:30 PM
As I look at it, one solution will be the following.

Separate the data into five columns with all the PlCodes in the first col, AvgAvailability values in separate columns for the four profiles. Now each row of the new table will have the PlCode in the first col and the other four cells will be empty.

Fill in the values of the AvgAvailability value in the cell that belongs to the Profile group of the PlCode. The remaining cells in the row will have 0 entered. Complete filling in the values.

Select all the five columns of values and select a stacked bar chart. This will now show bars of different color for each bar of the PlCode.
One problem is to display the data labels. Since this is a stacked chart, data labels for all the Profile columns in one row will be inserted.

Any suggestions how we can avoid this?